init.d or systemd?

Post your questions about SoftEther VPN software here. Please answer questions if you can afford.
Post Reply
cmpts_cpeacock
Posts: 5
Joined: Sun Aug 05, 2018 11:38 am

init.d or systemd?

Post by cmpts_cpeacock » Thu Aug 09, 2018 8:42 pm

Hi,

I understand systemd is the preference for services with latest version of Ubuntu. However, with the SE in Local Bridge mode how would you add the tap IP to the systemd script?

This is the working init.d script, but not sure how this would work when using systemd. Any advice?

# #!/bin/sh
### BEGIN INIT INFO
# Provides: vpnserver
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable Softether by daemon.
### END INIT INFO
DAEMON=/usr/local/vpnserver/vpnserver
LOCK=/var/lock/subsys/vpnserver
TAP_ADDR=192.168.30.1

test -x $DAEMON || exit 0
case "$1" in
start)
$DAEMON start
touch $LOCK
sleep 1
/sbin/ifconfig tap_tapint1 $TAP_ADDR
;;
stop)
$DAEMON stop
rm $LOCK
;;
restart)
$DAEMON stop
sleep 3
$DAEMON start
sleep 1
/sbin/ifconfig tap_tapint1 $TAP_ADDR
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0


Post Reply