Older Newer
Sun, 05 Feb 2006 06:20:23 . . . . derjohn
Sun, 05 Feb 2006 06:19:23 . . . . derjohn
Sun, 05 Feb 2006 06:18:44 . . . . derjohn [cleanup]
Sun, 05 Feb 2006 06:14:25 . . . . derjohn [created userland script for setting "autostart marks"]


Changes by last author:

Added:
Dummy line here or else the <code> tag doesnt work:

<code>

#!/bin/sh

# (c) Andreas John, licensed under GPL V2.

# first release, may need some more syntax checks.

# status: works for me :)

# works with newstyle config only

# The script's name should be vserver-autostart.

# copy it to /usr/local/sbin/vserver-autostart and chmod u+x /usr/local/sbin/vserver-autostart

confdir=/etc/vservers

if [ -z $1 ]; then echo

echo "usage: vserver-autostart <guestname> [<level>]"

echo "If you want to use other levels than default,"

echo "you need to modify the init script first."

echo "To disable autostart, set the level to \"none\"."

exit 0

fi

if [ ! -e $confdir/$1 ]; then

echo "The guest $1 does probably not exist"

echo "or you are not using newstyle-config."

exit 1

fi

# Delete the mark if $2 is none

if [ "$2" == "none" ]; then

if [ -e $confdir/$1/apps/init/mark ]; then

rm $confdir/$1/apps/init/mark

exit 0;

else

echo "Cannot remove autostart mark, because this guest was not set to autostart." ;

fi

elif [ -z $2 ]; then

# set the start level

level="default";

else

level=$2;

fi

# set the start mark

echo $level > $confdir/$1/apps/init/mark

</code>