#!/bin/sh
#=================================================================
# Begin lxc
#
# Description:	Starts/Stops all LXC containers configured for autostart.
# chkconfig:	345 98 02
#
#=================================================================

### BEGIN INIT INFO
# Provides:		lxc-net
# Required-Start:	$syslog
# Should-Start:		$syslog
# Required-Stop:
# Should-Stop:
# Default-Start:       3 4 5
# Default-Stop:        0 1 2 6
# Short-Description:   Bring up/down LXC Network Bridge
# Description:         Bring up/down LXC Network Bridge
### END INIT INFO

. /lib/lsb/init-functions

RETVAL=0
PROG="lxc-net"
CMD="/usr/libexec/lxc"

# Some functions to make the below more readable
case "$1" in
    start	)
      log_info_msg "Starting LXC network bridge:"
      $CMD/$PROG $1
      evaluate_retval
      ;;

    stop	)
      log_info_msg "Stopping LXC network bridge:"
      $CMD/$PROG $1
      evaluate_retval
      ;;

    reload	|				\
    restart	)
        $0 stop
        sleep 1
        $0 start
        ;;

    *)
        echo "Usage: $0 {start|stop|reload|restart}"
        exit 1
        ;;
esac

