summaryrefslogtreecommitdiff
path: root/pcr/strongswan/strongswan.rc
blob: 58c99c092bb5bae628265eef9770f857ab02f259 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/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