Add bash strict options.

This commit is contained in:
Nicolás A. Ortega Froysa 2024-12-31 11:03:56 +01:00
parent 46376f9242
commit 81af13a1ae
9 changed files with 27 additions and 5 deletions

3
backup
View File

@ -1,2 +1,5 @@
#!/bin/bash #!/bin/bash
set -euo pipefail
rsync -aAXv --delete "$1" --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found","/media/music/*"} "$2" rsync -aAXv --delete "$1" --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found","/media/music/*"} "$2"

View File

@ -1,2 +1,5 @@
#!/bin/bash #!/bin/bash
set -euo pipefail
sync && echo 1 > /proc/sys/vm/drop_caches sync && echo 1 > /proc/sys/vm/drop_caches

View File

@ -1,2 +1,5 @@
#!/bin/sh #!/bin/bash
set -euo pipefail
install -m 755 $1 $HOME/.local/bin install -m 755 $1 $HOME/.local/bin

View File

@ -1,2 +1,5 @@
#!/bin/bash #!/bin/bash
set -euo pipefail
curl ipinfo.io/$1 curl ipinfo.io/$1

View File

@ -1,4 +1,7 @@
#!/bin/sh #!/bin/bash
set -euo pipefail
[ "$#" -eq 0 ] && [ "$#" -eq 0 ] &&
echo "Requires a command. Run with 'help' for a list of commands." && echo "Requires a command. Run with 'help' for a list of commands." &&
exit 1 exit 1

2
setbg
View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
set -euo pipefail
if [ $# -gt 1 ] if [ $# -gt 1 ]
then then
echo "Too many arguments" echo "Too many arguments"

View File

@ -1,4 +1,6 @@
#!/bin/sh #!/bin/bash
set -euo pipefail
# TODO: # TODO:
# - Add options for port # - Add options for port

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
set -eu set -euo pipefail
CAMERA_DEVICE="" CAMERA_DEVICE=""
MOUNT_DIR="/tmp/camera-mount" MOUNT_DIR="/tmp/camera-mount"

View File

@ -1,2 +1,5 @@
#!/bin/sh #!/bin/bash
set -euo pipefail
curl "http://wttr.in/$1?m" curl "http://wttr.in/$1?m"