-
Notifications
You must be signed in to change notification settings - Fork 2
/
codeccli
executable file
·103 lines (91 loc) · 1.66 KB
/
codeccli
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/usr/bin/env bash
CURRENT_DIR=$(dirname $(realpath $0))
echo "-----[CodecCLI]-----"
echo ""
if [ -z $1 ]; then
echo "Error:"
echo "You need to define one subcommand!"
exit 1
fi
CMD="$1"
if [[ "$CMD" = restartall* ]]; then
CMD="restartall"
fi
if [[ "$CMD" = ena* ]]; then
CMD="enable"
fi
if [[ "$CMD" = dis* ]]; then
CMD="disable"
fi
if [[ "$CMD" = in* ]]; then
CMD="install"
fi
if [[ "$CMD" = un* ]]; then
CMD="uninstall"
fi
if [[ "$CMD" = up* ]]; then
CMD="updateall"
fi
if [[ "$CMD" = defaultp* ]]; then
CMD="defaultpass"
fi
if [[ "$CMD" = passh* ]]; then
CMD="passhash"
fi
if [[ "$CMD" = setp* ]]; then
CMD="setpass"
fi
if [[ "$CMD" = at* ]]; then
CMD="attach"
fi
if [[ "$CMD" = bu* ]]; then
CMD="build"
fi
if [[ "$CMD" = cr* ]]; then
CMD="cron"
fi
if [[ "$CMD" = un* ]]; then
CMD="uncron"
fi
if [[ "$CMD" = cl* ]]; then
CMD="close"
fi
if [[ "$CMD" = dev* ]]; then
CMD="dev"
elif [[ "$CMD" = de* ]]; then
CMD="delete"
fi
if [[ "$CMD" = ex* ]]; then
CMD="exist"
fi
if [[ "$CMD" = he* ]]; then
CMD="help"
fi
if [[ "$CMD" = lo* ]]; then
CMD="logs"
elif [[ "$CMD" = li* ]]; then
CMD="list"
fi
if [[ "$CMD" = pa* ]]; then
CMD="pass"
fi
if [[ "$CMD" = ra* ]]; then
CMD="randompass"
elif [[ "$CMD" = reseth* ]]; then
CMD="resethash"
elif [[ "$CMD" = reset ]]; then
CMD="reset"
fi
if [[ "$CMD" = sto* ]]; then
CMD="stopall"
elif [[ "$CMD" = st* ]]; then
CMD="start"
fi
if [ ! -f "$CURRENT_DIR/scripts/$CMD.sh" ]; then
echo "CodecCLI command $CMD not found!"
echo ""
echo "Help:"
$CURRENT_DIR/scripts/help.sh
exit 1
fi
$CURRENT_DIR/scripts/$CMD.sh ${@:2}