Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add standard bash error handling options #165

Merged
merged 3 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion home/bin/ws-aws
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/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
Loading