<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[bug: cacert-update.service]]></title><description><![CDATA[<p dir="auto">Na našich dvou neuronech jsem opravil tuto chybu. Asi se o ní už ví, ale pro jistotu posílám sem.</p>
<pre><code class="language-bash">#!/bin/bash
#
# get installed version of ca-certificate package
# write the version into virtual registers 4200-4201
#
# if used with --update, try update/upgrade package

CA_REG1=4300
CA_REG2=4301
VREG_DIR=/run/unipi-plc/virtual-regs

if &lsqb;&lsqb; "$TRIGGER_UNIT" =~ ".timer" &rsqb;&rsqb;; then
    apt-get update -y -qq || true
    apt-get install -y -q ca-certificates
fi

CA_VERSION=$(dpkg-query --show --showformat '${Version}' ca-certificates 2&gt;/dev/null)

# OPRAVA: Odřízne vše od prvního znaku, který není číslice (např. ~deb12u2)
CA_VERSION="${CA_VERSION%%[^0-9]*}"

if [ -z "$CA_VERSION" ]; then
    rm -f "$VREG_DIR/$CA_REG1"
    rm -f "$VREG_DIR/$CA_REG2" # Zde byla dříve chyba s redundantním /virtual-regs/
else
    mkdir -p "$VREG_DIR"
    if cd "$VREG_DIR"; then
        echo "$((CA_VERSION/10000))" &gt; "$VREG_DIR/$CA_REG1"
        echo "$((CA_VERSION%10000))" &gt; "$VREG_DIR/$CA_REG2"
    fi
fi
</code></pre>
]]></description><link>https://forum.unipi.technology/topic/1623/bug-cacert-update-service</link><generator>RSS for Node</generator><lastBuildDate>Wed, 28 Oct 2026 09:35:58 GMT</lastBuildDate><atom:link href="https://forum.unipi.technology/topic/1623.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 27 Oct 2026 08:35:12 GMT</pubDate><ttl>60</ttl></channel></rss>