Created
July 13, 2012 19:00
-
-
Save nikicat/3106703 to your computer and use it in GitHub Desktop.
Archlinux strongswan 5.0.0 rc.d script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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