-
Notifications
You must be signed in to change notification settings - Fork 0
/
finish.sh
63 lines (51 loc) · 1.33 KB
/
finish.sh
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
#!/bin/bash
## hint provides a sort of help functionality
function hint {
if [ ! -z "$1" ]
then
## print formatted hint
printf ${green}"%-40s"${NC} " $1"
printf ${yellow}"%-48s"${NC} "$2"
## newline
echo ''
fi
}
### thats it. Display help or succes info.
if [ -z "$SUCC" ]
then
## check for arguments
if [ -z "$CMD" ]
then
printf ${red}"No Command."${NC}
echo ''
else
##COMMENTED OUT - i think this should be deprecated
## check for the default command
#if [ "$CMD" == "$(/bin/srvctl ls | grep $CMD)" ]
#then
# /bin/srvctl exec $ARGS
# exit 76
#fi
printf ${red}"Invalid Command."${NC}
echo ''
fi
msg "Usage: srvctl command [argument]"
msg "list of currently active commands:"
hint_commands
## print formatted hint about man
printf ${green}"%-40s"${NC} " help"
printf ${yellow}"%-48s"${NC} "see more detailed descriptions about commands."
## newline
echo ''
echo ''
if $isROOT && $onVE
then
msg "CMS list:"
hint_cms
echo ''
fi
else
echo -e "$SUCC"
fi
## return to the directory we started from.
cd $CWD >> /dev/null 2> /dev/null