Skip to content

Commit 8551c26

Browse files
authored
Merge pull request SensorsIot#630 from Paraphraser/20221202-wireguard-helper-old-menu
2022-12-02 Wireguard helper script - old-menu branch - PR 2 of 3
2 parents d3cfa93 + 699a9e3 commit 8551c26

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

scripts/2022-10-01-wireguard-restructure.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
# support user renaming of script
44
SCRIPT=$(basename "$0")
55

6+
# dependency check
7+
if [ -z "$(which rsync)" -o -z "$(which jq)" ] ; then
8+
echo "This script depends on jq and rsync. Please run"
9+
echo " sudo apt update && sudo apt install jq rsync"
10+
exit -1
11+
fi
12+
613
# useful function
714
isContainerRunning() {
815
if STATUS=$(curl -s --unix-socket /var/run/docker.sock http://localhost/containers/$1/json | jq .State.Status) ; then
@@ -17,6 +24,13 @@ isContainerRunning() {
1724
# should not run as root
1825
[ "$EUID" -eq 0 ] && echo "$SCRIPT should NOT be run using sudo" && exit -1
1926

27+
# dependency check
28+
if [ -z "$(which rsync)" -o -z "$(which jq)" ] ; then
29+
echo "This script depends on jq and rsync. Please run"
30+
echo " sudo apt update && sudo apt install jq rsync"
31+
exit -1
32+
fi
33+
2034
read -r -d '' RUNNINGNOTES <<-EOM
2135
\n
2236
===============================================================================

0 commit comments

Comments
 (0)