1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-21 20:38:45 +00:00
freebsd-ports/games/wolfpack/scripts/configure
Chris D. Faulhaber 3263364474 Update port to 4.2.8
PR:		23605
Submitted by:	Maintainer
2000-12-19 01:17:36 +00:00

56 lines
1.5 KiB
Bash

#!/bin/sh
doquit () {
if [ $1 -ne 0 ]; then
echo User abort
rm -f $tempfile
exit 1
fi
}
name=`pw user show \`id -u\` | awk -F : '{print $8}'`
username=`id -un`
email=$username@`hostname`
host=`hostname`
ip=`host -t a $host | awk '{print $4}'`
tempfile=`mktemp -t __input`
if [ ! -z "$BATCH" ]; then
else
dialog --title "Wolfpack Empire Information" --inputbox "Name of deity" 8 60 "$name" 2>$tempfile
doquit $?
name=`cat $tempfile`
dialog --title "Wolfpack Empire Information" --inputbox "Username of deity" 8 60 "$username" 2>$tempfile
doquit $?
username=`cat $tempfile`
dialog --title "Wolfpack Empire Information" --inputbox "Email Address of game admin" 8 60 "$email" 2>$tempfile
doquit $?
email=`cat $tempfile`
dialog --title "Wolfpack Empire Information" --inputbox "Hostname of the machine the server is running on" 8 60 "$host" 2>$tempfile
doquit $?
host=`cat $tempfile`
dialog --title "Wolfpack Empire Information" --inputbox "IP of the machine the server is running on" 8 60 "$ip" 2>$tempfile
doquit $?
ip=`cat $tempfile`
rm -f $tempfile
fi
echo Name is $name
echo Username is $username
echo Email address is $email
echo Hostname is $host
echo IP is $ip
FROM=$FILESDIR/build.conf.tmpl
TO=$WRKSRC/build.conf
if [ -z "$CC" ]; then
CC=gcc
fi
sed -e "s/%%CC%%/$CC/" -e "s/%%NAME%%/$name/" -e "s/%%USERNAME%%/$username/" -e "s/%%EMAIL%%/$email/" -e "s/%%HOSTNAME%%/$host/" -e "s/%%IPADDR%%/$ip/" -e "s#%%EMPDIR%%#$PREFIX/wolfpack#" <$FROM >$TO