Commit b2715ec8 authored by Vitaly Lipatov's avatar Vitaly Lipatov

add interactive mode

parent 9fa92ed3
#!/bin/sh #!/bin/sh
if [ "$1" = "-i" ] ; then
shift
INTERACTIVE=1
fi
for id in $(vzlist | sed -e "s| *\([0-9]*\).*|\1|g") ; do for id in $(vzlist | sed -e "s| *\([0-9]*\).*|\1|g") ; do
CONF=/etc/vz/conf/$id.conf CONF=/etc/vz/conf/$id.conf
test -r $CONF || continue test -r $CONF || continue
eval `cat $CONF | grep ^HOSTNAME | sed -e "s|office.etersoft.ru||g"` eval `cat $CONF | grep ^HOSTNAME | sed -e "s|office.etersoft.ru||g"`
printf "%s (%20s):" $id $HOSTNAME printf "%s (%20s):" $id $HOSTNAME
if [ -n "$INTERACTIVE" ] ; then
echo "run $@? (Y/n)"
read n
[ -n "$n" ] && [ "$n" != "y" ] && continue
fi
vzctl exec $id "$@" vzctl exec $id "$@"
done done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment