]> git.proxmox.com Git - mirror_lxc.git/blob - config/init/sysvinit/lxc-containers.in
Rework init scripts
[mirror_lxc.git] / config / init / sysvinit / lxc-containers.in
1 #!/bin/sh
2 #
3 # lxc Start/Stop LXC autoboot containers
4 #
5 # chkconfig: 345 99 01
6 # description: Starts/Stops all LXC containers configured for autostart.
7 #
8 ### BEGIN INIT INFO
9 # Provides: lxc
10 # Default-Start: 2 3 4 5
11 # Default-Stop: 0 1 6
12 # Short-Description: Bring up/down LXC autostart containers
13 # Description: Bring up/down LXC autostart containers
14 ### END INIT INFO
15
16 start() {
17 @LIBEXECDIR@/lxc/lxc-containers start
18 }
19
20 stop() {
21 @LIBEXECDIR@/lxc/lxc-containers stop
22 }
23
24 # See how we were called.
25 case "$1" in
26 start)
27 start
28 ;;
29
30 stop)
31 stop
32 ;;
33
34 restart|reload|force-reload)
35 $0 stop
36 $0 start
37 ;;
38
39 *)
40 echo "Usage: $0 {start|stop|restart|reload|force-reload}"
41 exit 2
42 ;;
43 esac
44
45 exit $?