diff options
-rw-r--r-- | satellit_upgrader/updater.template.sh | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/satellit_upgrader/updater.template.sh b/satellit_upgrader/updater.template.sh index d58d850..58d3368 100644 --- a/satellit_upgrader/updater.template.sh +++ b/satellit_upgrader/updater.template.sh @@ -14,16 +14,16 @@ if [ "$(lsb_release -si)" != "Debian" ]; then exit 1 fi -TEST2=$(lsb_release -sr) -if [ "${TEST2%%.*}" -lt 8 ]; then +MAJOR=$(lsb_release -sr) +MAJOR=${MAJOR%%.*} +if [ "${MAJOR}" -lt 8 ]; then echo "This Version of the bwLehrpool Satellite Server is too old!" exit 1 fi -if [ "${TEST2%%.*}" -gt 8 ]; then +if [ "${MAJOR}" -gt 8 ]; then echo "This Version of the bwLehrpool Satellite Server is too new!" exit 1 fi -unset TEST2 unset TMPDIR [ -n "$TMPDIR" ] && exit 1 @@ -423,14 +423,23 @@ if ! grep -q -E '^\s*post_max_size = 100M' "$PHPINIFILE"; then RESTART_LIGHTY=ja fi +# ******************* atftpd update ************************ +echo "* Updating atftpd" +if [ "$MAJOR" = 8 ] && [ -s "$FILEDIR/atftpd32.deb" ] && [ "$(uname -m)" == "i686" ]; then + echo "Updating package" + if ! dpkg -i "$FILEDIR/atftpd32.deb" > "$TMPDIR/apt.log" 2>&1; then + cat "$TMPDIR/apt.log" + pwarning "Could not update atftpd." + fi +fi + # ********************** atftpd.service ******************** if [ -e "$FILEDIR/atftpd.service" ]; then - echo "* Replacing atftpd.service" + echo "Replacing atftpd.service" cp "$FILEDIR/atftpd.service" "/etc/systemd/system/atftpd.service" || perror "Could not replace /etc/systemd/system/atftpd.service" ln -s -f "../atftpd.service" "/etc/systemd/system/multi-user.target.wants/" systemctl daemon-reload restart_service atftpd - echo "Service file replaced" fi # ********************** dmsd.service ********************** |