feat: guard option in bash to prevent script from running after error

This commit is contained in:
angeD 2021-12-28 14:01:53 +01:00
parent 96c24ba956
commit 12cbefe3dd
4 changed files with 3 additions and 1 deletions

View File

@ -1,4 +1,5 @@
#!/usr/bin/bash #!/usr/bin/bash
set -e
if [ "$EUID" -ne 0 ]; then if [ "$EUID" -ne 0 ]; then
echo "error: you cannot perform this operation unless you are root." echo "error: you cannot perform this operation unless you are root."

View File

@ -1,4 +1,5 @@
#!/usr/bin/bash #!/usr/bin/bash
set -e
# counts target = 8182 ~ 25cm # counts target = 8182 ~ 25cm

View File

@ -1,4 +1,5 @@
#!/usr/bin/bash #!/usr/bin/bash
set -e
device="PNP0C50:0e 06CB:7E7E Touchpad" device="PNP0C50:0e 06CB:7E7E Touchpad"

View File

@ -1,5 +1,4 @@
#!/usr/bin/bash #!/usr/bin/bash
set -e set -e
if [ "$EUID" -eq 0 ]; then if [ "$EUID" -eq 0 ]; then