由于工作需要配置了sersync2服务,但是没提供启动和停止的脚本,就自己写了个粗糙的。
- #! /bin/bash
- #
- #sersyncd
- #
- . /etc/rc.d/init.d/functions
- case "$1" in
- start)
- cd /usr/local/sersync
- ./sersync2 -o /usr/local/sersync/project.xml -r -d
- if [ $? -eq 0 ]
- then
- echo -e "Staring sersyncd [ OK ]"
- exit 0
- fi
- ;;
- stop)
- kill `ps aux | grep sersync2 | grep -v grep | awk '{print $2}'`
- if [ $? -eq 0 ]
- then
- echo -e "Stopping sersyncd [ OK ]"
- exit 0
- fi
- ;;
- status)
- ps aux | grep sersync2 | grep -v grep
- ;;
- esac
转载于:https://blog.51cto.com/rhca30/512688