|
|
@ -1,8 +1,7 @@ |
|
|
|
#!/bin/sh /etc/rc.common |
|
|
|
|
|
|
|
SERVICE_USE_PID=1 |
|
|
|
|
|
|
|
START=50 |
|
|
|
USE_PROCD=1 |
|
|
|
|
|
|
|
setup_config() { |
|
|
|
config_get port $1 port "4443" |
|
|
@ -96,7 +95,7 @@ setup_dns() { |
|
|
|
echo "dns = $ip" >> /var/etc/ocserv.conf |
|
|
|
} |
|
|
|
|
|
|
|
start() { |
|
|
|
start_service() { |
|
|
|
local hostname iface |
|
|
|
|
|
|
|
hostname=`uci show ddns 2>/dev/null|grep domain|head -1|cut -d '=' -f 2` |
|
|
@ -162,23 +161,8 @@ start() { |
|
|
|
chmod 600 /var/etc/ocpasswd |
|
|
|
config_foreach setup_users ocservusers |
|
|
|
|
|
|
|
service_start /usr/sbin/ocserv -c /var/etc/ocserv.conf |
|
|
|
} |
|
|
|
|
|
|
|
stop() { |
|
|
|
service_stop /usr/sbin/ocserv |
|
|
|
} |
|
|
|
|
|
|
|
reload() { |
|
|
|
rm -f /var/etc/ocpasswd |
|
|
|
touch /var/etc/ocpasswd |
|
|
|
chmod 600 /var/etc/ocpasswd |
|
|
|
config_foreach setup_users ocservusers |
|
|
|
|
|
|
|
/usr/bin/occtl show status >/dev/null 2>&1 |
|
|
|
if test $? != 0;then |
|
|
|
start |
|
|
|
else |
|
|
|
/usr/bin/occtl reload |
|
|
|
fi |
|
|
|
procd_open_instance |
|
|
|
procd_set_param command /usr/sbin/ocserv -f -c /var/etc/ocserv.conf |
|
|
|
procd_set_param respawn |
|
|
|
procd_close_instance |
|
|
|
} |