fix: make updates.sh path-independent and fix InfluxData keyring usage
- updates.sh: use BASH_SOURCE to find script dir, so fix_apt_influx.sh can be called from anywhere (was failing with 'command not found' when run from outside the updates_scripts directory) - fix_apt_influx.sh: if key download fails but keyring already exists on disk, reuse it with [signed-by=] instead of falling back to [trusted=yes] which disables signature verification entirely - Fixes: Missing key AC10D7449F343ADCEFDDC2B6DA61C26A0585BD3B error on Trixie when running updates.sh
This commit is contained in:
1 parent
38c558867a
commit
1e6b35f078
2 files changed
+11
-4
No files matched your search
Regular → Executable
+9
-3
@@ -31,9 +31,15 @@ if [ -s /tmp/influxdata-archive.key ]; then
|
||||
echo "deb [signed-by=/usr/share/keyrings/influxdata-archive.gpg] https://repos.influxdata.com/debian stable main" \
|
||||
| sudo tee /etc/apt/sources.list.d/influxdata.list >/dev/null
|
||||
else
|
||||
# Fallback: use trusted=yes (signature verification disabled)
|
||||
echo "deb [trusted=yes] https://repos.influxdata.com/debian stable main" \
|
||||
| sudo tee /etc/apt/sources.list.d/influxdata.list >/dev/null
|
||||
# Fallback: use existing keyring if already present
|
||||
if [ -f /usr/share/keyrings/influxdata-archive.gpg ]; then
|
||||
echo "deb [signed-by=/usr/share/keyrings/influxdata-archive.gpg] https://repos.influxdata.com/debian stable main" \
|
||||
| sudo tee /etc/apt/sources.list.d/influxdata.list >/dev/null
|
||||
else
|
||||
# Last resort: trusted=yes (signature verification disabled)
|
||||
echo "deb [trusted=yes] https://repos.influxdata.com/debian stable main" \
|
||||
| sudo tee /etc/apt/sources.list.d/influxdata.list >/dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "==> Fixing Sury PHP repo key"
|
||||
|
||||
Regular → Executable
+2
-1
@@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
sudo ./fix_apt_influx.sh
|
||||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
sudo "$DIR/fix_apt_influx.sh"
|
||||
|
||||
sudo apt update
|
||||
sudo apt upgrade -y
|
||||
|
||||
Reference in new issue
Block a user