Compare commits

..

2 Commits

Author SHA1 Message Date
e5a8d2d21b Fix: correctly check if environment variables are set 2024-06-27 14:57:16 +02:00
e295e915d8 Stop on errors 2024-06-27 14:56:48 +02:00

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/bin/bash -e
function log { function log {
echo "$(date +'%Y-%m-%d %H:%M:%S') $@" echo "$(date +'%Y-%m-%d %H:%M:%S') $@"
@ -10,7 +10,7 @@ if [ -f "/etc/sshutter.conf" ]; then
fi fi
# Check if args are given # Check if args are given
if [ "$WHITELIST" -eq "" ] || [ "$PORT" -eq "" ] || [ "$TARGET" -eq "" ]; then if [ "$WHITELIST" == "" ] || [ "$PORT" == "" ] || [ "$TARGET" == "" ]; then
echo "Error: you need to specify WHITELIST, PORT and TARGET, either in /etc/sshutter.conf or through environment variables." 1>&2 echo "Error: you need to specify WHITELIST, PORT and TARGET, either in /etc/sshutter.conf or through environment variables." 1>&2
exit 1 exit 1
fi fi