diff options
author | Simon Rettberg | 2023-09-28 15:58:30 +0200 |
---|---|---|
committer | Simon Rettberg | 2023-09-28 15:58:30 +0200 |
commit | 961e828b21114ebf026de252f3b8176cddd0653d (patch) | |
tree | bfebe27c89cfc5f3d0aa5599e05406776c93bb78 | |
parent | [SSPS] Rewrite CA/cert generator and handling (diff) | |
download | setup-scripts-961e828b21114ebf026de252f3b8176cddd0653d.tar.gz setup-scripts-961e828b21114ebf026de252f3b8176cddd0653d.tar.xz setup-scripts-961e828b21114ebf026de252f3b8176cddd0653d.zip |
[SSUS] Add support for Debian 12, reword Debian 9 warning text a bit
-rw-r--r-- | satellit_upgrader/updater.template.sh | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/satellit_upgrader/updater.template.sh b/satellit_upgrader/updater.template.sh index c9c7e67..5cd45b6 100644 --- a/satellit_upgrader/updater.template.sh +++ b/satellit_upgrader/updater.template.sh @@ -40,6 +40,7 @@ if ! (( MAJOR > 0 )); then exit 1 fi +delay= readonly MAJOR CODENAME if (( MAJOR < 9 )); then echo "This Version of the bwLehrpool Satellite Server is too old!" @@ -54,7 +55,7 @@ fi if (( MAJOR == 9 )); then echo "This server is still running Debian ${MAJOR}. Debian ${MAJOR} does not receive any" echo "security patches since 2022-06-20. It is strongly recommended to upgrade" - echo "to Debian 12 before installing this bwLehrpool server update," + echo "to at least Debian 10 (ideally, 12) before installing this bwLehrpool server update," echo "either by doing a dist-upgrade, or by backing up the configuration and" echo "importing it into a freshly installed server." if [ -z "$FORCE" ]; then @@ -63,8 +64,12 @@ if (( MAJOR == 9 )); then echo "line option, i.e. $0 --update --force" exit 1 fi - echo -n "About to begin update.." - for _ in x x x x x x; do + delay=1 +fi + +if [ -n "$delay" ]; then + echo -n "About to begin update in 10 seconds (press Ctrl-C to abort).." + for _ in {1..10}; do sleep 1 echo -n . done @@ -302,16 +307,24 @@ fi if (( MAJOR == 9 )); then java="7" # highest UNWANTED version - php="-1" # highest UNWANTED version + phpmajor="7" # WANTED + php="-1" # highest UNWANTED version minor (7.x) mysql="10.1" # WANTED version elif (( MAJOR == 10 )); then java="10" # highest UNWANTED version - php="2" # highest UNWANTED version + phpmajor="7" # WANTED + php="2" # highest UNWANTED version minor (7.x) mysql="10.3" # WANTED version elif (( MAJOR == 11 )); then java="10" # highest UNWANTED version - php="3" # highest UNWANTED version + phpmajor="7" # WANTED + php="3" # highest UNWANTED version minor (7.x) mysql="10.5" # WANTED version +elif (( MAJOR == 12 )); then + java="16" # highest UNWANTED version + phpmajor="8" # WANTED + php="1" # highest UNWANTED version minor (8.x) + mysql="10.11" # WANTED version else perror "Abort" fi @@ -327,8 +340,11 @@ aptinst default-jre-headless # Same for php dpkg -l 'php5-*' | grep -q '^ii' && apt remove -y "php5-*" -for ver in $(seq 0 "$php"); do - dpkg -l "php7.${ver}-*" 2> /dev/null | grep -q '^ii' && apt remove -y "php7.${ver}-*" +for ver in $( seq 7 "$(( phpmajor - 1 ))" ); do + dpkg -l "php${ver}.?-*" | grep -q '^ii' && apt remove -y "php${ver}.?-*" +done +for ver in $( seq 0 "$php" ); do + dpkg -l "php${phpmajor}.${ver}-*" 2> /dev/null | grep -q '^ii' && apt remove -y "php${phpmajor}.${ver}-*" done aptinst php-cgi aptinst php-cli @@ -342,6 +358,7 @@ aptinst php-soap # MySQL... for ver in $( dpkg-query -W -f='${Package}\n' "mysql-server-*" "mariadb-server-*" ); do [[ "$ver" == *"-$mysql" ]] && continue + [[ "$ver" =~ -[.0-9]+$ ]] || continue dpkg -l "$ver" 2> /dev/null | grep -q '^ii' && apt remove -y "$ver" done aptinst default-mysql-server |