@@ -10,7 +10,7 @@ SHUTDOWNCHECK_BASEURL="${SHUTDOWNCHECK_BASEURL:-"https://raw.githubusercontent.c
1010# We provide a fallback in case `EUID` is not set; silence shellcheck violation
1111# warning that "In POSIX sh, EUID is undefined"
1212# shellcheck disable=SC3028
13- if [ " ${EUID:- $(id -u 2>/ dev/ null || : )} " != 0 ]; then
13+ if [ " ${EUID:- $(id -u 2> / dev/ null || : )} " != 0 ]; then
1414 run_as_root () {
1515 sudo " $@ "
1616 }
2020 }
2121fi
2222
23- if command -v curl 1> /dev/null 2>&1 ; then
23+ if command -v curl 1> /dev/null 2>&1 ; then
2424 fetch () {
2525 run_as_root curl -fsSLo " $2 " " $1 "
2626 }
27- elif command -v wget 1> /dev/null 2>&1 ; then
27+ elif command -v wget 1> /dev/null 2>&1 ; then
2828 fetch () {
2929 run_as_root wget -o " $2 " " $1 "
3030 }
@@ -55,7 +55,7 @@ install_polling_script() {
5555
5656looks_like_elec_distro () {
5757 # shellcheck disable=SC1091
58- . /etc/os-release 1> /dev/null 2>&1 || :
58+ . /etc/os-release 1> /dev/null 2>&1 || :
5959
6060 case " ${NAME:- } " in
6161 * ELEC)
@@ -75,7 +75,7 @@ looks_like_elec_distro() {
7575 # 2. Have the directory `/storage/.config`, and
7676 # 3. Use a `sudo` wrapper that issues a warning about not needing sudo
7777 # and then exits with a non-zero status.
78- [ " ${EUID:- $(id -u 2>/ dev/ null || : )} " -eq 0 ] && [ -d /storage/.config ] && ! sudo true
78+ [ " ${EUID:- $(id -u 2> / dev/ null || : )} " -eq 0 ] && [ -d /storage/.config ] && ! sudo true
7979}
8080
8181if looks_like_elec_distro; then
@@ -92,14 +92,14 @@ ${dest}
9292 exit
9393fi
9494
95- if command -v whiptail 1> /dev/null 2>&1 ; then
95+ if command -v whiptail 1> /dev/null 2>&1 ; then
9696 get_script_type () {
9797 whiptail --title " ATXRaspi/MightyHat shutdown/reboot script setup" --menu " \nChoose your script type option below:\n\n(Note: changes require reboot to take effect)" 15 78 4 \
9898 " 1" " Install INTERRUPT based script /etc/shutdownirq.py (recommended)" \
9999 " 2" " Install POLLING based script /etc/shutdowncheck.sh (classic)" \
100100 " 3" " Disable any existing shutdown script" 3>&1 1>&2 2>&3
101101 }
102- elif (help select) 1> /dev/null 2>&1 ; then
102+ elif (help select) 1> /dev/null 2>&1 ; then
103103 # Eval this, as otherwise we're liable to get a syntax error from shells that
104104 # do not understand `select ...; do ...; done`
105105 eval '
@@ -132,13 +132,12 @@ else
1321322) Install POLLING based script /etc/shutdowncheck.sh (classic)
1331333) Disable any existing shutdown script"
134134
135-
136135 while true ; do
137136 echo 1>&2 ' Choose your script type option: '
138137
139138 if read -r REPLY; then
140139 case " ${REPLY:- } " in
141- 1|2| 3)
140+ 1 | 2 | 3)
142141 echo " $REPLY "
143142 return
144143 ;;
0 commit comments