#!/bin/sh
# Helper script for all the v_xxx scripts
USR_SBIN=/usr/sbin
if [ $# = 0 ] ; then
	echo vsysvwrapper service_name >&2
else
	SERVICE=$1
	shift
	IP=eth0
	if [ -f /etc/vservices/$SERVICE.conf ] ; then
		. /etc/vservices/$SERVICE.conf
	fi
	IPOPT=
	for oneip in $IP
	do
		IPOPT="$IPOPT --ip $oneip"
	done
	echo exec $USR_SBIN/chbind $IPOPT /etc/init.d/$SERVICE $*
	exec $USR_SBIN/chbind $IPOPT /etc/init.d/$SERVICE $*
fi


