#!/bin/sh # an installation script for Wnn6 check_pw() { if which -s pw; then : else cat <> ${FILE} rm ${FILE}.bak else echo "Please add 'wnn6 22273/tcp' into ${FILE}, and try again." exit 1 fi fi ## Hack /etc/master.passwd ## # check id_69=`id -u 69 2> /dev/null` id_wnn=`id -u wnn 2> /dev/null` if [ X"$id_wnn" = X69 ];then exit 0 elif [ X"$id_69" != X ]; then cat < ${startup_script}; echo "wnn=${wnnserver}" >> ${startup_script}; echo 'case $1 in' >> ${startup_script}; echo 'start)' >> ${startup_script}; echo ' if [ -f $wnn ]; then' >> ${startup_script}; echo " echo -n ' ${wnnname}'" >> ${startup_script}; echo ' $wnn' >> ${startup_script}; echo " fi" >> ${startup_script}; echo ' ;;' >> ${startup_script}; echo 'stop)' >> ${startup_script}; echo ' killall $wnn' >> ${startup_script}; echo " echo -n ' ${wnnname}'" >> ${startup_script}; echo ' ;;' >> ${startup_script}; echo '*)' >> ${startup_script}; echo ' echo "Usage: `basename $0` {start|stop}" >&2' >> ${startup_script}; echo ' ;;' >> ${startup_script}; echo 'esac' >> ${startup_script}; echo 'exit 0' >> ${startup_script}; chmod 755 ${startup_script} chown bin:bin ${startup_script} fi ;; esac