diff options
Diffstat (limited to 'util-vserver/tools/vdispatch-conf')
-rwxr-xr-x | util-vserver/tools/vdispatch-conf | 126 |
1 files changed, 0 insertions, 126 deletions
diff --git a/util-vserver/tools/vdispatch-conf b/util-vserver/tools/vdispatch-conf deleted file mode 100755 index 5949887..0000000 --- a/util-vserver/tools/vdispatch-conf +++ /dev/null @@ -1,126 +0,0 @@ -#!/bin/bash -# -# vdispatch-conf - Update config files in vservers -# Copyright (C) 2005 Benedikt Boehm <hollow@gentoo.org> -# Christian Heim <phreak@gentoo.org> -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - -: ${APP:=${0##*/}} -: ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars} - -if [ ! -e ${UTIL_VSERVER_VARS} ]; then - echo "Cannot find util-vserver installation" - echo "(the file '$UTIL_VSERVER_VARS' would be expected)" - exit 1 -fi - -source ${UTIL_VSERVER_VARS} - -if [ ! -e ${_LIB_GENTOO_FUNCTIONS} ]; then - echo "${_LIB_GENTOO_FUNCTIONS} missing. Are you running Gentoo?" - exit 1 -fi - -source ${_LIB_GENTOO_FUNCTIONS} - -trap "exit 1" INT - -dispatchconf() { -# $1 - name of the vserver - einfo "Updating config files for '${1}'" - /usr/sbin/vserver ${1} exec /usr/sbin/dispatch-conf - echo -} - -usage() { - echo "Usage: vupdateworld <opts> [<name>]" - echo - echo "<name> Name of the vserver (required if --all not used)" - echo - echo "Options:" - echo " -h, --help This help message" - echo " -a, --all Update all running vservers" - echo " -e, --exclude <list> Exclude single vservers with --all" - echo -} - -# Parsing opts -opts=$(POSIXLY_CORRECT=1 getopt -o hae: --longoptions help,all,exclude: -n $0 -- "$@") - -[ "$?" != "0" ] && die "Wrong number of options" - -eval set -- "$opts" - -all=0 -exclude= - -while true; do - case "${1}" in - --help|-h) - usage - exit 0 - ;; - --all|-a) - all=1 - shift - ;; - --exclude|-e) - exclude=$2 - shift 2 - ;; - --) - shift - break - ;; - *) - die "Unknown argument '${1}'" - ;; - esac -done - -# checking vserver name -name= -if [ -z "$1" ] && [ ${all} -eq 0 ]; then - die "Missing argument <name>" -else - name=$1 -fi -shift - -# get list of all running vservers -if [ ${all} -eq 0 ]; then - vservers=${name} -else - running=$(vs_running_name) - vservers= - - for r in ${running}; do - match=0 - - for e in ${exclude}; do - [ "${r}" == "${e}" ] && match=1 - done - - [ ! -f "${__CONFDIR}/${r}/vdir/etc/gentoo-release" ] && match=1 - - [ ${match} -eq 0 ] && vservers="${vservers} ${r}" - done -fi - -# finally, update configs -for vserver in ${vservers}; do - dispatchconf ${vserver} -done |