Skip to content

Instantly share code, notes, and snippets.

@nikicat
Created July 13, 2012 19:00
Show Gist options
  • Save nikicat/3106703 to your computer and use it in GitHub Desktop.
Save nikicat/3106703 to your computer and use it in GitHub Desktop.
Archlinux strongswan 5.0.0 rc.d script
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
case "$1" in
start)
stat_busy "Starting strongSwan IPsec"
/usr/sbin/ipsec start
if [ $? -gt 0 ]; then
stat_fail
else
stat_done
add_daemon strongswan
fi
;;
stop)
stat_busy "Stopping strongSwan IPsec"
/usr/sbin/ipsec stop
if [ $? -gt 0 ]; then
stat_fail
else
stat_done
rm_daemon strongswan
fi
;;
restart)
stat_busy "Restarting strongSwan IPsec"
/usr/sbin/ipsec restart
if [ $? -gt 0 ]; then
stat_fail
else
stat_done
add_daemon strongswan
fi
;;
status)
/usr/sbin/ipsec status
;;
*)
echo "usage: $0 {start|stop|restart|status}"
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment