File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 3
3
# support user renaming of script
4
4
SCRIPT=$( basename " $0 " )
5
5
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
+
6
13
# useful function
7
14
isContainerRunning () {
8
15
if STATUS=$( curl -s --unix-socket /var/run/docker.sock http://localhost/containers/$1 /json | jq .State.Status) ; then
@@ -17,6 +24,13 @@ isContainerRunning() {
17
24
# should not run as root
18
25
[ " $EUID " -eq 0 ] && echo " $SCRIPT should NOT be run using sudo" && exit -1
19
26
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
+
20
34
read -r -d ' ' RUNNINGNOTES << -EOM
21
35
\n
22
36
===============================================================================
You can’t perform that action at this time.
0 commit comments