forked from kaf-systems/openfire-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathof-cli
38 lines (34 loc) · 769 Bytes
/
of-cli
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
36
37
38
#!/bin/bash
# 2016 lgg https://github.com/lgg/openfire-cli
pathOpenFire="/opt/openfire/bin/openfire"
usageExample="command usage: ./of-cli ACTION"
usageActions="ACTIONS: start/status/stop/restart/force-reload"
if [ -z "$1" ]; then
echo "ERR: no ACTION given"
echo "$usageExample"
echo "$usageActions"
exit 1
else
action="$1"
fi
if [ "$action" = "start" ]
then
($pathOpenFire start)
elif [ "$action" = "status" ]
then
($pathOpenFire status)
elif [ "$action" = "stop" ]
then
($pathOpenFire stop)
elif [ "$action" = "restart" ]
then
($pathOpenFire restart)
elif [ "$action" = "force-reload" ]
then
($pathOpenFire force-reload)
else
echo "ERR: wrong ACTION"
echo "$usageExample"
echo "$usageActions"
exit 1
fi