Commit c1779996 authored by Jan Grewe's avatar Jan Grewe
Browse files

Fix variables in start.sh

parent 7cebdc3b
......@@ -2,24 +2,24 @@
dir='/nquakesv'
remote_ip=$(curl http://myip.dnsomatic.com)
[ -n "$hostdns" ] || hostdns=$remote_ip
REMOTE_IP=$(curl http://myip.dnsomatic.com)
[ -n "$HOSTDNS" ] || HOSTDNS=${REMOTE_IP}
echo "===== nQuakeSV Configuration ====="
echo "Setting server name: ${HOSTNAME}"
echo $hostname > ~/.nquakesv/hostname
echo ${HOSTNAME} > ~/.nquakesv/hostname
/bin/sed -i "s/hostname .*/hostname ${HOSTNAME}/" ktx/port1.cfg
/bin/sed -i "s/.*k_motd1 .*/set k_motd1 \"${HOSTNAME}\"/" ktx/port1.cfg
/bin/sed -i "s/hostname .*/hostname ${HOSTNAME}/" qtv/qtv.cfg
/bin/sed -i "s/set hostname .*/set hostname \"${HOSTNAME}\"/" qwfwd/qwfwd.cfg
echo "Setting server hostname: ${HOSTDNS}"
echo $hostdns > ~/.nquakesv/hostdns
echo $remote_ip > ~/.nquakesv/ip
echo ${HOSTDNS} > ~/.nquakesv/hostdns
echo ${REMOTE_IP} > ~/.nquakesv/ip
#/bin/sed -i "s/qtv .*/qtv ${HOSTDNS}:28501/" qtv/qtv.cfg
/bin/sed -i "s/qtv .*/qtv 127.0.0.1:28501/" qtv/qtv.cfg
/bin/sed -i "s/sv_serverip .*/sv_serverip \"${remote_ip}:28501\"/" ktx/port1.cfg
/bin/sed -i "s/sv_serverip .*/sv_serverip \"${HOSTDNS}:28501\"/" ktx/port1.cfg
echo "Setting server admin: ${ADMINNAME} <${ADMINEMAIL}>"
echo "${ADMINNAME} <${ADMINEMAIL}>" > ~/.nquakesv/admin
......@@ -49,3 +49,4 @@ echo "=================================="
/usr/bin/supervisorctl start nquakesv:*
exit 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment