#!/bin/sh
# @vasm : INITSET
# @level: root
# @description: choose SysV Init or VL Init
# 
# (c) Kocil, 2003
# (c) VLocity Linux, 2003

vdir=$(dirname $0)
. $vdir/vasm-functions

check_root

RC_SYSVINIT="/etc/rc.d/rc.sysvinit"
RC_VLINIT="/etc/rc.d/rc.vlinit"

# Select WM
menuA()
{

TITLE="INIT SYSTEM"
TEXT="\n
Initialization system starts or stops services when\n
you switch run level using the command:\n
   init <run_level>\n
The standard initialization system is called SysV-Init.\n
When switching run level, it kills all services of the\n
previous level then start all services of the new level.\n
VLocity Linux offers a faster init system. It does not\n
kill the services if only to be started again in the\n
next run level.\n\n
So, give your vote:"
DIMENSION="20 64  2"


    $DCMD --backtitle "$BACKTITLE" --title "$TITLE" \
    --menu "$TEXT" $DIMENSION \
    "SYSVINIT" "Standard System-V initialization" \
    "VLINIT" "Faster VL initialization" \
    2> $freply

    status=$?
    [ $status != 0 ] && return $status

    CHOICE=`cat $freply`
    dbug "Choice=$CHOICE"

    infobox "Setting init system to $CHOICE" "DONE"
    if [ "$CHOICE" = "SYSVINIT" ]; then
	chmod +x $RC_SYSVINIT
    else
	chmod -x $RC_SYSVINIT
	chmod +x $RC_VLINIT
    fi
    sleep 2
    return 0
}

menuA
clean_exit $?


