archie/release/scripts/start-weaseld

36 lines
767 B
Plaintext
Raw Normal View History

2024-05-27 20:18:02 +02:00
#!/bin/sh
get_home()
{
if [ $# -ne 1 ] ; then
fatal "get_home: bad number of arguments"
fi
if p=`grep "^${1}:" /etc/passwd` ; then
echo $p | awk -F: '{print $6}'
elif p=`ypmatch $1 passwd` ; then
echo $p | awk -F: '{print $6}'
else
fatal "get_home: can't find home directory for $1"
fi
}
check_uid_root()
{
id=`id | sed 's/(.*$//' | sed 's/^.*=//'`;
# echo "Your uid is $id";
if [ "$id" -ne "0" ]; then
echo "Warning! Weaseld will not start unless you are running it as root"
echo " or you're running with the -debug flag"
fi
}
HOME=`get_home archie`
check_uid_root;
if $HOME/bin/weaseld -user archie -proot /MENU/gopher.archie_release $* ; then
echo "";
else
echo "Problem starting weaseld";
fi