Beginner 95f915abf1
luci-app: tidy up code (#8277)
1.文件尾部添加换行并删除多余的换行

2.整理代码,看起来更直观

3.更正文件的权限

4.将一些文件的CR LF末行符全部转为LF
2021-11-21 14:48:21 +08:00

38 lines
919 B
Bash
Executable File

#!/bin/sh /etc/rc.common
# Copyright (c) 2011-2015 OpenWrt.org
START=90
start(){
if [ ! -f "/tmp/vlmcsd.pid" ]; then
/usr/bin/vlmcsd -i /etc/vlmcsd/vlmcsd.ini -p /tmp/vlmcsd.pid -L 0.0.0.0:1688
iptables -D input_rule -p tcp --dport 1688 -j ACCEPT
iptables -A input_rule -p tcp --dport 1688 -j ACCEPT
sed -i '/## luci-app-vlmcsd/d' /etc/firewall.user
echo "iptables -A input_rule -p tcp --dport 1688 -j ACCEPT ## luci-app-vlmcsd" >> /etc/firewall.user
echo "KMS Server has started."
else
echo "KMS Server has already started."
fi
}
stop(){
if [ ! -f "/tmp/vlmcsd.pid" ]; then
echo "KMS Server is not running."
else
pid=`cat /tmp/vlmcsd.pid`
kill $pid
rm -f /tmp/vlmcsd.pid
iptables -D input_rule -p tcp --dport 1688 -j ACCEPT
sed -i '/## luci-app-vlmcsd/d' /etc/firewall.user
echo "KMS Server has stopped."
fi
}
restart(){
stop
sleep 2
start
echo "KMS Server has restarted."
}