Skip to content

Commit

Permalink
Always re-enable print (if exit before slib download)
Browse files Browse the repository at this point in the history
  • Loading branch information
iliajie committed Sep 9, 2022
1 parent 03bfdf5 commit 81e439e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions virtualmin-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ else
INTERACTIVE_MODE="on"
fi

# Set a trap to catch any exit, whether
# normal or forced (e.g. Ctrl-C)
enable_stty () {
if [ "${INTERACTIVE_MODE}" != "off" ];then
stty echo
fi
}
trap enable_stty INT QUIT TERM EXIT

# Print usage info, if --help, set mode, etc.
# Temporary colors
if [ "${INTERACTIVE_MODE}" != "off" ];then
Expand Down Expand Up @@ -1233,8 +1242,4 @@ else
printf "${errorlist}"
fi

if [ "${INTERACTIVE_MODE}" != "off" ];then
stty echo
fi

exit 0

0 comments on commit 81e439e

Please sign in to comment.