Browse Source

ocserv: use procd for init file

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
lilik-openwrt-22.03
Nikos Mavrogiannopoulos 10 years ago
parent
commit
0bfd280c2d
1 changed files with 6 additions and 22 deletions
  1. +6
    -22
      net/ocserv/files/ocserv.init

+ 6
- 22
net/ocserv/files/ocserv.init View File

@ -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
}

Loading…
Cancel
Save