pve-manager/services/pvenetcommit
Thomas Lamprecht 81c713fcfd cleanup: rename bin/init.d to services
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-06-20 13:04:51 +02:00

45 lines
766 B
Bash

#!/bin/sh
### BEGIN INIT INFO
# Provides: pvenetcommit
# Required-Start: checkroot
# Required-Stop:
# Default-Start: S
# Default-Stop:
# Short-Description: commits network changes
### END INIT INFO
set -e
. /lib/lsb/init-functions
PATH=/sbin:/bin
IFFN=/etc/network/interfaces
# we cant use perl here, because this skript runs before
# we have /usr mounted
case "$1" in
start)
# remove OVS config
rm -f /etc/openvswitch/conf.db
if test -f "${IFFN}.new"; then
echo "committing new network configuration";
if ! mv "${IFFN}.new" $IFFN; then
echo "unable to commit changes to '${IFFN}' - $!\n";
fi
fi
;;
stop|restart|force-reload)
exit 0
;;
*)
echo "Usage: /etc/init.d/pvenetcommit {start}"
exit 0
;;
esac
exit 0