Skip to content

Instantly share code, notes, and snippets.

@Corben78
Created Aug 27, 2018
Embed
What would you like to do?
bash script to start and stop a Windows Aliens vs. Predator (2010) dedicated server on Linux with wine
#!/bin/bash
# Installation:
# Laden des Windows Binaries unter Linux
#./steamcmd.sh +login user pass +force_install_dir /home/steam/avpds +@sSteamCmdForcePlatformType windows +app_update 34120 +quit
DISPLAY=${DISPLAY:-:1}
WINEPREFIX=/home/steam/wine/avpds
#DISPLAY=localhost:10.0
. /lib/lsb/init-functions
case $1 in
start)
/sbin/start-stop-daemon --start --pidfile xvfb.pid --make-pidfile --exec /usr/bin/Xvfb --background -- :1
DISPLAY=$DISPLAY WINEPREFIX=$WINEPREFIX /sbin/start-stop-daemon --start --pidfile avp.pid --make-pidfile --chdir $WINEPREFIX/drive_c/avpds --exec /usr/bin/wine --background -- 'C:\avpds\AvP_CLI.exe'
;;
stop)
/sbin/start-stop-daemon --stop --quiet --retry=TERM/1/KILL/5 --pidfile avp.pid --name AvP_CLI.exe
/sbin/start-stop-daemon --stop --quiet --retry=TERM/1/KILL/5 --pidfile xvfb.pid --name Xvfb
;;
status)
status_of_proc -p xvfb.pid /usr/bin/Xvfb xvfb
status_of_proc -p avp.pid /usr/bin/wine avpds
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment