-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathapp.sh
More file actions
executable file
·35 lines (30 loc) · 796 Bytes
/
app.sh
File metadata and controls
executable file
·35 lines (30 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
ARG1=$1
ARG2=$2
# Make sure working dir is same as this dir, so that script can be excuted from another working directory
PARENT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
set -u ## exit the script if you try to use an uninitialised variable
set -e ## exit the script if any statement returns a non-true return value
. scripts/helpers.sh
. scripts/printers.sh
if [ -z "${ARG1}" ]; then
help
elif [ "${ARG1}" == "install" ]; then
stop
install
elif [ "${ARG1}" == "init" ]; then
init ${ARG2}
printservices
elif [ "${ARG1}" == "start" ]; then
stop
start "${ARG2}"
printservices
elif [ "${ARG1}" == "stop" ]; then
stop
elif [ "${ARG1}" == "reset" ]; then
reset
elif [ "${ARG1}" == "logs" ]; then
logs "${ARG2}"
else
help
fi