Skip to content

Commit

Permalink
Merge pull request SensorsIot#631 from Paraphraser/20221202-wireguard…
Browse files Browse the repository at this point in the history
…-helper-experimental

2022-12-02 Wireguard helper script - experimental branch - PR 3 of 3
  • Loading branch information
Slyke authored Jan 5, 2023
2 parents 1d88b3e + 8e25b54 commit 36e81c6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions scripts/2022-10-01-wireguard-restructure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
# support user renaming of script
SCRIPT=$(basename "$0")

# dependency check
if [ -z "$(which rsync)" -o -z "$(which jq)" ] ; then
echo "This script depends on jq and rsync. Please run"
echo " sudo apt update && sudo apt install jq rsync"
exit -1
fi

# useful function
isContainerRunning() {
if STATUS=$(curl -s --unix-socket /var/run/docker.sock http://localhost/containers/$1/json | jq .State.Status) ; then
Expand All @@ -17,6 +24,13 @@ isContainerRunning() {
# should not run as root
[ "$EUID" -eq 0 ] && echo "$SCRIPT should NOT be run using sudo" && exit -1

# dependency check
if [ -z "$(which rsync)" -o -z "$(which jq)" ] ; then
echo "This script depends on jq and rsync. Please run"
echo " sudo apt update && sudo apt install jq rsync"
exit -1
fi

read -r -d '' RUNNINGNOTES <<-EOM
\n
===============================================================================
Expand Down

0 comments on commit 36e81c6

Please sign in to comment.