vlmcsd.init 549 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/sh /etc/rc.common
  2. # Copyright (c) 2011-2015 OpenWrt.org
  3. START=90
  4. start(){
  5. if [ ! -f "/tmp/vlmcsd.pid" ]; then
  6. /usr/bin/vlmcsd -i /etc/vlmcsd.ini -p /tmp/vlmcsd.pid -l syslog -L 0.0.0.0:1688
  7. echo "KMS Server has started."
  8. else
  9. echo "KMS Server has already started."
  10. fi
  11. }
  12. stop(){
  13. if [ ! -f "/tmp/vlmcsd.pid" ]; then
  14. echo "KMS Server is not running."
  15. else
  16. pid=`cat /tmp/vlmcsd.pid`
  17. kill $pid
  18. rm -f /tmp/vlmcsd.pid
  19. echo "KMS Server has stopped."
  20. fi
  21. }
  22. restart(){
  23. stop
  24. sleep 1
  25. start
  26. echo "KMS Server has restarted."
  27. }