Skip to content

Commit

Permalink
non interactive mode for getting started Linux script
Browse files Browse the repository at this point in the history
  • Loading branch information
sylefeb committed Aug 26, 2024
1 parent 454d6bf commit a1ca8fb
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions get_started_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,23 @@ echo "--------------------------------------------------------------------"
echo " >>>> it will request sudo access to install packages <<<<"
echo "--------------------------------------------------------------------"

read -p "Please type 'y' to go ahead, any other key to exit: " -n 1 -r
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
echo
echo "Exiting."
exit
non_interactive=false
if [[ "$1" == "--non-interactive" ]]; then
non_interactive=true
fi

if [ "$non_interactive" = true ]; then
echo "non-interactive mode"
else
read -p "Please type 'y' to go ahead, any other key to exit: " -n 1 -r
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
echo
echo "Exiting."
exit
fi
echo ""
fi
echo ""

# -------------- install packages ----------------------------
# attempt to guess
Expand Down

0 comments on commit a1ca8fb

Please sign in to comment.