mirror of
https://github.com/natelandau/shell-scripting-templates.git
synced 2025-11-09 05:33:48 -05:00
Minor tweak to comments
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
# of many of my scripts
|
# of many of my scripts
|
||||||
#
|
#
|
||||||
# All of this taken whole-cloth from: https://github.com/kvz/bash3boilerplate
|
# All of this taken whole-cloth from: https://github.com/kvz/bash3boilerplate
|
||||||
#####################################################################q
|
#####################################################################
|
||||||
|
|
||||||
# Translate usage string -> getopts arguments, and set $arg_<flag> defaults
|
# Translate usage string -> getopts arguments, and set $arg_<flag> defaults
|
||||||
while read line; do
|
while read line; do
|
||||||
|
|||||||
@@ -277,10 +277,10 @@ function skip() {
|
|||||||
REPLY=noskip
|
REPLY=noskip
|
||||||
read -t 5 -n 1 -s -p "${bold}To skip, press ${underline}X${reset}${bold} within 5 seconds.${reset}"
|
read -t 5 -n 1 -s -p "${bold}To skip, press ${underline}X${reset}${bold} within 5 seconds.${reset}"
|
||||||
if [[ "$REPLY" =~ ^[Xx]$ ]]; then
|
if [[ "$REPLY" =~ ^[Xx]$ ]]; then
|
||||||
echo " Skipping!"
|
notice " Skipping!"
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
echo " Continuing..."
|
notice " Continuing..."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ done
|
|||||||
# Trap bad exits with your cleanup function
|
# Trap bad exits with your cleanup function
|
||||||
trap trapCleanup EXIT INT TERM
|
trap trapCleanup EXIT INT TERM
|
||||||
|
|
||||||
# Exit on error. Append ||true if you expect an error.
|
# Exit on error. Append '||true' when you run the script if you expect an error.
|
||||||
set -o errexit
|
set -o errexit
|
||||||
|
|
||||||
# Run in debug mode, if set
|
# Run in debug mode, if set
|
||||||
@@ -223,10 +223,9 @@ if [ "${strict}" == "1" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Bash will remember & return the highest exitcode in a chain of pipes.
|
# Bash will remember & return the highest exitcode in a chain of pipes.
|
||||||
# This way you can catch the error in case mysqldump fails in `mysqldump |gzip`
|
# This way you can catch the error in case mysqldump fails in `mysqldump |gzip`, for example.
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
|
|
||||||
mainScript # Run your script
|
mainScript # Run your script
|
||||||
|
|
||||||
safeExit # Exit cleanly
|
safeExit # Exit cleanly
|
||||||
Reference in New Issue
Block a user