#! /bin/bash
### Configure

RUNLEVELCONF=/var/service/runlevelconf

### End configure
if [ ! -d $RUNLEVELCONF ]; then
    echo "$(basename $0): $RUNLEVELCONF does not exist"
    exit 2
else
    cd $RUNLEVELCONF
fi

if [ ! -f rlc.functions ]; then
    echo "$(basename $0): Cannot find rlc.functions"
    exit 2    
else
    . ./rlc.functions
fi

if [ $# = 0 ]; then
    echo "$(basename $0): Usage:"
    help_go "runlevel[s|k]"
    exit 2
fi

runlevel_syntax $1

if [ $# != 1 ]; then
    echo "$(basename $0): Usage:"
    help_go $1
    exit 2
else
    set "$(echo $1 | sed -e 's}s$}}' -e 's}k$}}')"
fi

if [ ! -f $1.current ]; then
    echo "Cannot find $1.current; assuming an empty one."
    touch $1.current
fi

create_s_and_k $1



