mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-25 10:03:03 +01:00
5d20d66320
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
45 lines
579 B
Bash
45 lines
579 B
Bash
#!/bin/sh
|
|
#
|
|
# /etc/rc.d/rc.iked
|
|
#
|
|
# Start/stop/restart the Shrew Soft IKE daemon.
|
|
#
|
|
|
|
# Start iked:
|
|
iked_start() {
|
|
if [ -x /usr/sbin/iked ]; then
|
|
echo "Starting the Shrew Soft IKE daemon: /usr/sbin/iked"
|
|
|
|
if [ -z "$(/sbin/lsmod | grep "^tun ")" ]; then
|
|
/sbin/modprobe tun
|
|
fi
|
|
|
|
/usr/sbin/iked
|
|
fi
|
|
}
|
|
|
|
# Stop iked:
|
|
iked_stop() {
|
|
killall iked
|
|
}
|
|
|
|
# Restart iked:
|
|
iked_restart() {
|
|
iked_stop
|
|
sleep 1
|
|
iked_start
|
|
}
|
|
|
|
case "$1" in
|
|
'start')
|
|
iked_start
|
|
;;
|
|
'stop')
|
|
iked_stop
|
|
;;
|
|
'restart')
|
|
iked_restart
|
|
;;
|
|
*)
|
|
echo "usage $0 start|stop|restart"
|
|
esac
|