#!/bin/csh -f
#Tag 1024
# Script to allow for changing system configuration variables
# JTN: Dec 1997

if(`printenv SW_BASE` == "") setenv SW_BASE /usr/local/softWoRx
if(`uname -s` == "Linux") then
	set TARG=`uname -p`
else
	set TARG=mips
endif

# allow for a -nowait flag so there's no delay at the end
set NOWAIT = 'F'
if($#argv >= 1) then
	if($argv[1] == "-nowait") set NOWAIT = 'T'
endif

if(`whoami` != 'root') then
	echo ""
	echo "<--> You'll need to provide superuser (root) password for this..."
endif

# Run the Configuration Program
set COMMAND="$SW_BASE/bin/$TARG/UserConfig -f $SW_BASE/config/variables_sys.cfg $SW_BASE/config/system.swrc"
su root -c "$COMMAND"
if($status) then
    echo ""
	echo " ### Configuration File Modification Failed... ###"
else
    echo ""
    echo "<--> Changes will take effect after softWoRx is re-started"
	echo " "
endif

# keep the message on the screen unless the -nowait switch was given
if($NOWAIT == 'F') sleep 6

