sersync启动/停止脚本

由于工作需要配置了sersync2服务,但是没提供启动和停止的脚本,就自己写了个粗糙的。

 

  
  
  
  
  1. #! /bin/bash  
  2. #  
  3. #sersyncd  
  4. #  
  5. . /etc/rc.d/init.d/functions  
  6.  
  7. case "$1" in  
  8.         start)  
  9.         cd /usr/local/sersync  
  10.         ./sersync2 -o /usr/local/sersync/project.xml -r -d  
  11.         if [ $? -eq 0 ]  
  12.                 then   
  13.                 echo -e "Staring sersyncd      [  OK  ]" 
  14.                 exit 0  
  15.         fi  
  16.         ;;  
  17.         stop)  
  18.         kill `ps aux | grep sersync2 | grep -v grep | awk '{print $2}'`  
  19.         if [ $? -eq 0 ]  
  20.                 then   
  21.                 echo -e "Stopping sersyncd     [  OK  ]" 
  22.                 exit 0  
  23.         fi  
  24.         ;;  
  25.         status)  
  26.         ps aux | grep sersync2 | grep -v grep  
  27.         ;;  
  28. esac 

 

你可能感兴趣的:(职场,休闲,sersync)