Linux Start Script

General discussion for off-topic subjects.
User avatar
Painkiller
Senior Member
Posts: 403
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

Linux Start Script

Postby Painkiller » Sat Dec 22, 2018 4:09 pm

Hello Source Python Team and Community,

I would like to run this script as a screen.
every time i enter putty ./start28060.sh and close the console, the server goes down.

Would anyone agree to help me?
Thanks in Advance

Code: Select all

#!/bin/bash
srcds() {
cd steam
uprun="default"
synpath="steamapps/common/Synergy"
if [ $uprun = "rb" ];then synpath="steamapps/common/synbeta";fi
if [ $uprun = "b" ];then synpath="steamapps/common/synbeta";fi
if [ $uprun = "rt" ];then synpath="steamapps/common/syntwitch";fi
if [ $uprun = "t" ];then synpath="steamapps/common/syntwitch";fi
if [ ! -f ./$synpath/srcds_run ];then notinstalled;fi
if [ ! -d ./steamapps/common/Half-Life\ 2 ];then insthl2;fi
if [ ! -L ./$synpath/bin/libtier0.so ];then
   mv ./$synpath/bin/libtier0.so ./$synpath/bin/libtier0.so.bak
   ln -s libtier0_srv.so ./$synpath/bin/libtier0.so
fi
if [ ! -L ./$synpath/bin/libvstdlib.so ];then
   mv ./$synpath/bin/libvstdlib.so ./$synpath/bin/libvstdlib.so.bak
   ln -s libvstdlib_srv.so ./$synpath/bin/libvstdlib.so
fi
reds
}

reds() {
./$synpath/srcds_run -game synergy -console +maxplayers 32 +sv_lan 0 +map d1_trainstation_06 +exec server2.cfg -ip 178.63.18.62 -port 28060 -nocrashdialog -insecure -nohltv
sleep 1
reds
}

srcds
DeaD_EyE
Junior Member
Posts: 2
Joined: Wed Jan 08, 2014 10:32 am

Re: Linux Start Script

Postby DeaD_EyE » Fri Dec 28, 2018 11:40 pm

What happens if you start the script with: nohup ./scriptname.sh &
Otherwise you can run it inside a screen or tmux. Tmux is better.

If I remind right, the command for screen to start a session and detach it:

screen -mdS gameserver_name ./scriptname.sh

BTW: Post next time the source: https://gist.githubusercontent.com/Bali ... install.sh
User avatar
Painkiller
Senior Member
Posts: 403
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

Re: Linux Start Script

Postby Painkiller » Sat Dec 29, 2018 11:23 am

Ok its works ty.

Return to “Whatever”

Who is online

Users browsing this forum: No registered users and 1 guest