1
0
forked from finn/tinyboard

offboard-spoke.sh: run as root, remove sudo from python3 install

This commit is contained in:
Justin Oros
2026-04-18 14:04:24 -07:00
parent 535c8a47cb
commit 74e1a9d1a0
6 changed files with 51 additions and 26 deletions

View File

@@ -28,8 +28,20 @@ check_deps() {
fi
}
if [ "$(id -u)" -eq 0 ]; then
die "Run as the hub user, not root."
[ "$(id -u)" -eq 0 ] || die "Run as root"
if ! command -v python3 >/dev/null 2>&1; then
if command -v apt-get >/dev/null 2>&1; then
apt-get install -y -q python3
elif command -v dnf >/dev/null 2>&1; then
dnf install -y -q python3
elif command -v yum >/dev/null 2>&1; then
yum install -y -q python3
elif command -v pacman >/dev/null 2>&1; then
pacman -S --noconfirm python
else
die "python3 not found and no supported package manager to install it"
fi
fi
check_deps rclone crontab python3