-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrs.sh
52 lines (50 loc) · 975 Bytes
/
rs.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
function start(){
/serverspeeder/bin/serverSpeeder.sh start
}
function stop(){
/serverspeeder/bin/serverSpeeder.sh stop
}
function restart(){
/serverspeeder/bin/serverSpeeder.sh restart
}
function status(){
/serverspeeder/bin/serverSpeeder.sh status
}
function config(){
checkos
if [ "$OS" == 'CentOS' ]; then
vi /serverspeeder/etc/config
else
vim /serverspeeder/etc/config
fi
}
function checkos(){
if [ -f /etc/redhat-release ];then
OS=CentOS
elif [ ! -z "`cat /etc/issue | grep bian`" ];then
OS=Debian
elif [ ! -z "`cat /etc/issue | grep Ubuntu`" ];then
OS=Ubuntu
else
echo "Not support OS, Please reinstall OS and retry!"
exit 1
fi
}
if [ ! -n "$1" ]; then
status
elif [ $1 = "start" ]; then
start
elif [ $1 = "stop" ]; then
stop
elif [ $1 = "restart" ]; then
restart
elif [ $1 = "status" ]; then
status
elif [ $1 = "config" ]; then
config
else
echo "
print error bash ./rs.sh $1
"
exit 1
fi