0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield#!/bin/sh -
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield#
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield# lxc-net Start/Stop LXC Networking
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield#
fce070c815604e863f4628ecceb172ffdbbb2465Dwight Engen# chkconfig: 345 98 01
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield# description: Starts/Stops LXC Network Bridge
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield#
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield### BEGIN INIT INFO
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield# Provides: lxc-net
66188b02b8009075a2e0e2b89a14688c50565bf4Evgeni Golov# Required-Start: $syslog $remote_fs
66188b02b8009075a2e0e2b89a14688c50565bf4Evgeni Golov# Required-Stop: $syslog $remote_fs
66188b02b8009075a2e0e2b89a14688c50565bf4Evgeni Golov# Should-Start:
66188b02b8009075a2e0e2b89a14688c50565bf4Evgeni Golov# Should-Stop:
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield# Default-Start: 2 3 4 5
d2b51fd10886f9c23c1f237c7ce1abaaa843067eEvgeni Golov# Default-Stop: 0 1 6
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield# Short-Description: Bring up/down LXC Network Bridge
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield# Description: Bring up/down LXC Network Bridge
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield### END INIT INFO
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield
02fdb536a98e116232548dff6c2faed849e8796fEvgeni Golov# To be replaced by LSB functions, if they can be found
02fdb536a98e116232548dff6c2faed849e8796fEvgeni Golov# Defined here for distributions that don't have log_daemon_msg
02fdb536a98e116232548dff6c2faed849e8796fEvgeni Golovlog_daemon_msg () {
02fdb536a98e116232548dff6c2faed849e8796fEvgeni Golov echo $@
02fdb536a98e116232548dff6c2faed849e8796fEvgeni Golov}
fce070c815604e863f4628ecceb172ffdbbb2465Dwight Engen
02fdb536a98e116232548dff6c2faed849e8796fEvgeni Golov# Try to source LSB init functions to define LSB log_* functions.
02fdb536a98e116232548dff6c2faed849e8796fEvgeni Golovtest ! -r /lib/lsb/init-functions ||
02fdb536a98e116232548dff6c2faed849e8796fEvgeni Golov . /lib/lsb/init-functions
fce070c815604e863f4628ecceb172ffdbbb2465Dwight Engen
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfieldstart() {
02fdb536a98e116232548dff6c2faed849e8796fEvgeni Golov log_daemon_msg "Starting LXC network bridge: "
02fdb536a98e116232548dff6c2faed849e8796fEvgeni Golov @LIBEXECDIR@/lxc/lxc-net start
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield}
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfieldstop() {
02fdb536a98e116232548dff6c2faed849e8796fEvgeni Golov log_daemon_msg "Stopping LXC network bridge: "
02fdb536a98e116232548dff6c2faed849e8796fEvgeni Golov @LIBEXECDIR@/lxc/lxc-net stop
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield}
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield# See how we were called.
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfieldcase "$1" in
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield start)
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield start
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield ;;
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield stop)
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield stop
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield ;;
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield restart|reload|force-reload)
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield $0 stop
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield $0 start
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield ;;
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield *)
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield echo "Usage: $0 {start|stop|restart|reload|force-reload}"
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield exit 2
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield ;;
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfieldesac
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfield
0af993195cbd57cff700c7c90ee8f95c2a1ef8aaMichael H. Warfieldexit $?