7feb6fb594
Approved by: portmgr (implicit)
43 lines
1 KiB
Bash
43 lines
1 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`
|
|
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`
|
|
|
|
rm -f $tempfile
|
|
fi
|
|
echo Name is $name
|
|
echo Username is $username
|
|
echo Email address is $email
|
|
|
|
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#%%EMPDIR%%#$PREFIX/wolfpack#" <$FROM >$TO
|