Skip to content

Commit

Permalink
Add standard bash error handling options
Browse files Browse the repository at this point in the history
  • Loading branch information
andytson-inviqa committed Feb 21, 2024
1 parent 3abf7e1 commit 76b3561
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 6 deletions.
4 changes: 3 additions & 1 deletion home/bin/ws-poweroff
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash

set -e -o pipefail
set -o errexit
set -o nounset
set -o pipefail

DIR=""

Expand Down
6 changes: 5 additions & 1 deletion home/bin/ws-service
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

set -o errexit
set -o nounset
set -o pipefail

DIR=""
TRAEFIK_NETWORK="my127ws"

Expand Down Expand Up @@ -34,7 +38,7 @@ bootstrap()
return
fi

if ! docker network ls | grep "${TRAEFIK_NETWORK}" > /dev/null; then
if ! docker network inspect "${TRAEFIK_NETWORK}" > /dev/null; then
run docker network create "$TRAEFIK_NETWORK"
fi
}
Expand Down
6 changes: 5 additions & 1 deletion home/service/logger/init.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

set -o errexit
set -o nounset
set -o pipefail

DIR=""

main()
Expand Down Expand Up @@ -36,7 +40,7 @@ bootstrap()
# shellcheck source=../../lib/sidekick.sh
source "$DIR/../../lib/sidekick.sh"

cd "$DIR" || exit 1
cd "$DIR"
}

bootstrap
Expand Down
6 changes: 5 additions & 1 deletion home/service/mail/init.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

set -o errexit
set -o nounset
set -o pipefail

DIR=""

main()
Expand Down Expand Up @@ -36,7 +40,7 @@ bootstrap()
# shellcheck source=../../lib/sidekick.sh
source "$DIR/../../lib/sidekick.sh"

cd "$DIR" || exit 1
cd "$DIR"
}

bootstrap
Expand Down
4 changes: 3 additions & 1 deletion home/service/proxy/init.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash

set -e
set -o errexit
set -o nounset
set -o pipefail

DIR=""

Expand Down
4 changes: 3 additions & 1 deletion home/service/tracing/init.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash

set -e
set -o errexit
set -o nounset
set -o pipefail

DIR=""

Expand Down

0 comments on commit 76b3561

Please sign in to comment.