Skip to content

Commit

Permalink
Merge pull request #29 from jvonau/patch-2
Browse files Browse the repository at this point in the history
Sync from jvonau:patch-2
  • Loading branch information
holta authored Aug 21, 2021
2 parents d2f6943 + 50ddbb6 commit cad5a4e
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions iiab
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ set -e # Exit on error (avoids snowballing)
export DEBIAN_FRONTEND=noninteractive # Bypass (most!) interactive questions
FLAGDIR=/etc/iiab/install-flags
APTPATH=/usr/bin # Avoids problematic /usr/local/bin/apt on Linux Mint
EXPRESS=0

if [ "$1" == "--express" ]; then
EXPRESS=1
shift
fi

[ $(id -un) = root ] || { echo "Please run 'sudo iiab'" ; exit 1 ; }

Expand Down Expand Up @@ -197,18 +203,23 @@ if (( $(wc -c < /tmp/apt.stderr) > 82 )); then # apt.stderr typically contain
elif grep -q 'apt list --upgradable' /tmp/apt.stdout; then # apt.stdout typically contains {"All packages are up to date.\n" [even if primary locale is French & Hindi!], "Todos los paquetes están actualizados.\n", "所有软件包均为最新。\n"} ...OR... {"5 packages can be upgraded. Run 'apt list --upgradable' to see them.\n" [even if primary locale is French & Hindi!], "Se puede actualizar 1 paquete. Ejecute «apt list --upgradable» para verlo.\n", "有 1 个软件包可以升级。请执行 ‘apt list --upgradable’ 来查看它们。\n"}
cat /tmp/apt.stdout
echo -e "\nYour OS will now be upgraded...this takes time. THEN IT WILL AUTO-REBOOT.\n"

echo -n "Hit [ENTER] to confirm you'll RUN 'sudo iiab' AFTER IT REBOOTS: "
read ans < /dev/tty
echo
$APTPATH/apt -y dist-upgrade
reboot
exit 0 # Nec to avoid both output lines below (that confuse implementers!)
if [ $EXPRESS == 0 ]; then
echo -n "Hit [ENTER] to confirm you'll RUN 'sudo iiab' AFTER IT REBOOTS: "
read ans < /dev/tty
echo
$APTPATH/apt -y dist-upgrade
reboot
exit 0 # Nec to avoid both output lines below (that confuse implementers!)
else
$APTPATH/apt -y dist-upgrade
fi
fi
cat /tmp/apt.stdout # "All packages are up to date.\n"

echo -ne "\nHit [ENTER] to confirm you'll TRY TO RERUN 'sudo iiab' IF THERE IS A PROBLEM: "
read ans < /dev/tty
if [ $EXPRESS == 0 ]; then
echo -ne "\nHit [ENTER] to confirm you'll TRY TO RERUN 'sudo iiab' IF THERE IS A PROBLEM: "
read ans < /dev/tty
fi

####################### MAIN INTERACTIVE STUFF IS ABOVE #######################

Expand Down

0 comments on commit cad5a4e

Please sign in to comment.