mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2024-11-19 18:00:22 +01:00
add option for duration of delay
This commit is contained in:
parent
0904f5dd66
commit
decb80507c
@ -4,6 +4,57 @@
|
||||
# this script gets started by the autologin of the pi user and
|
||||
# and its output is gets displayed on the LCD or the RaspiBlitz
|
||||
|
||||
function usage() {
|
||||
echo -e "This script gets started by the autologin of the pi user and "
|
||||
echo -e "and its output is gets displayed on the LCD or the RaspiBlitz."
|
||||
echo -e ""
|
||||
echo -e "Usage: $0 [-h|--help] [-v*|--verbose] [-p|--pause STRING]"
|
||||
echo -e ""
|
||||
echo -e " -h, --help\t\tprint this help message"
|
||||
echo -e " -v, --verbose\t\tbe more verbose"
|
||||
echo -e " -p, --pause STRING\ttime in seconds to pause"
|
||||
echo -e ""
|
||||
}
|
||||
|
||||
# Default Values
|
||||
verbose=0
|
||||
pause=12
|
||||
|
||||
while [[ "$1" == -* ]]; do
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
-v*)
|
||||
(( verbose += ${#1} - 1 ))
|
||||
;;
|
||||
--verbose)
|
||||
(( verbose++ ))
|
||||
;;
|
||||
-p|--pause)
|
||||
shift
|
||||
pause="$1"
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
;;
|
||||
*)
|
||||
echo "Unrecognized option $1."
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if ! [[ "$pause" =~ ^[[:digit:]]+$ ]]; then
|
||||
echo "pause must be a positive integer or 0." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# CONFIGFILE - configuration of RaspiBlitz
|
||||
configFile="/mnt/hdd/raspiblitz.conf"
|
||||
|
||||
@ -18,7 +69,9 @@ fi
|
||||
|
||||
# display a 10s startup time
|
||||
source /home/admin/_version.info
|
||||
dialog --pause " Starting RaspiBlitz v${codeVersion} ..." 8 58 12
|
||||
if [ "$pause" -ne "0" ]; then
|
||||
dialog --pause " Starting RaspiBlitz v${codeVersion} ..." 8 58 ${pause}
|
||||
fi
|
||||
|
||||
# DISPLAY LOOP
|
||||
chain=""
|
||||
@ -229,4 +282,4 @@ while :
|
||||
|
||||
done
|
||||
|
||||
fi
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user