Browse Source

Added hostname input teeworlds

pull/512/head
Daniel Gibbs 10 years ago
parent
commit
d64a808e0f
  1. 59
      functions/fn_install_config

59
functions/fn_install_config

@ -10,6 +10,27 @@ cp -v "${servercfgdefault}" "${servercfgfullpath}"
sleep 1
}
fn_userinputconfig(){
# allow user to input server name and password
if [ -z "${autoinstall}" ]; then
echo ""
echo "Configuring ${gamename} Server"
echo "================================="
sleep 1
read -p "Enter server name: " servername
read -p "Enter rcon password: " rconpass
else
servername="${servicename}"
rconpass="rconpassword"
fi
echo "changing hostname."
sed -i "s/\"<hostname>\"/\"${servername}\"/g" "${servercfgfullpath}"
sleep1
echo "changing rconpassword."
sed -i "s/\"<rconpassword>\"/\"${rconpass}\"/g" "${servercfgfullpath}"
sleep 1
}
fn_arma3config(){
fn_defaultconfig
echo "creating ${networkcfg} config file."
@ -38,20 +59,7 @@ echo "creating banned.cfg."
touch "${systemdir}/banned.cfg"
sleep 1
# allow user to input server name and password
if [ -z "${autoinstall}" ]; then
echo ""
echo "Configuring ${gamename} Server"
echo "================================="
sleep 1
read -p "Enter server name: " servername
read -p "Enter rcon password: " rconpass
else
servername="${servicename}"
rconpass="rconpassword"
fi
sed -i "s/\"<hostname>\"/\"${servername}\"/g" "${servercfgfullpath}"
sed -i "s/\"<rconpassword>\"/\"${rconpass}\"/g" "${servercfgfullpath}"
fn_userinputconfig
echo ""
}
@ -76,28 +84,21 @@ echo "server.cfg > ${servercfg}."
echo "exec ${servercfg}" > "server.cfg"
sleep 1
# allow user to input server name and password
if [ -z "${autoinstall}" ]; then
echo ""
echo "Configuring ${gamename} Server"
echo "================================="
sleep 1
read -p "Enter server name: " servername
read -p "Enter rcon password: " rconpass
else
servername="${servicename}"
rconpass="rconpassword"
fi
sed -i "s/\"<hostname>\"/\"${servername}\"/g" "${servercfgfullpath}"
sed -i "s/\"<rconpassword>\"/\"${rconpass}\"/g" "${servercfgfullpath}"
fn_userinputconfig
echo ""
}
fn_teeworldsconfig(){
fn_defaultconfig
echo "adding logfile location to config."
sed -i "s/\"logfile\"/\"logfile ${gamelog}\"/g" "${servercfgfullpath}"
sed -i "s@\"<logfile>\"@\"${gamelog}\"@g" "${servercfgfullpath}"
sleep 1
echo "removing password holder."
sed -i "s/<password>//" "${servercfgfullpath}"
sleep 1
fn_userinputconfig
echo ""
}

Loading…
Cancel
Save