-
Notifications
You must be signed in to change notification settings - Fork 120
Expand file tree
/
Copy pathrs.sh
More file actions
executable file
·34 lines (30 loc) · 715 Bytes
/
rs.sh
File metadata and controls
executable file
·34 lines (30 loc) · 715 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
#!/bin/bash
master_pid=/tmp/rs_master.pid
slave_pid=/tmp/rs_slave.pid
cur_path=$(pwd)
case $1 in
master)
if test "$2" == "start"
then
${cur_path}/objs/rs_master -c ${cur_path}/etc/master.cf
elif test "$2" == "stop"
then
kill $(cat ${master_pid})
else
echo "arguments error (master|slave) (start|stop)"
fi
;;
slave)
if test "$2" == "start"
then
${cur_path}/objs/rs_slave -c ${cur_path}/etc/slave.cf
elif test "$2" == "stop"
then
kill $(cat ${slave_pid})
else
echo "arguments error (master|slave) (start|stop)"
fi
;;
*)
echo "arguments error (master|slave) (start|stop)" ;;
esac