From c5c9a9343a90d32966fb235e0fe4d0fc0df707cd Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 1 Feb 2018 11:13:52 +0100 Subject: [SSUS] Allow updating atftpd via .deb --- satellit_upgrader/updater.template.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'satellit_upgrader') 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 ********************** -- cgit v1.2.3-55-g7522