pkg install xorg xfce sddm i386-wine winetricks xrdp x11vnc xdotool bash
pkg install firefox
pkg install chromium
sysrc xrdp_enable=YES
sysrc dbus_enable=YES
sysrc sddm_enable=YES
echo "[Autologin]" >> /usr/local/etc/sddm.conf
echo "User=server" >> /usr/local/etc/sddm.conf
echo "Session=xfce.desktop" >> /usr/local/etc/sddm.conf
shutdown -r now
x11vnc -auth /home/server/.Xauthority -passwd "1234" -forever
x11vnc -passwd "1234" -forever
winetricks --self-update
exit
winetricks
Please Log in or Create an account to join the conversation.
ee /etc/hosts
65.112.87.186 hd2.available.gamespy.com #hidden and dangerous 2 check
65.112.87.186 hd2.master.gamespy.com #hidden and dangerous 2 heartbeats
65.112.87.186 hd2.ms14.gamespy.com #hidden and dangerous 2 server list
#!/bin/sh
# Set the variables below
##############################################
serverid='server1'
gamedir='/home/server/.wine/drive_c/HD2/'
winelocation='/usr/local/bin/wine'
hdexecutable='HD2DS_SabreSquadron1.exe'
serverhome='/home/server/'
##############################################
serverid=hd2server${serverid}
echo "Daemon Hidden and Dangerous II Server Launcher by Paul Blair/toadlife (paulwblair@live.com)"
echo Game Dir: $gamedir
echo Server ID: $serverid
echo WINE Location: $winelocation
echo HD2 Executable: $hdexecutable
echo Server Home: $serverhome
cd $gamedir
echo Changed directory to $gamedir
supervisor_pidfile=$serverhome$serverid'.pid'
echo Set supervisor pid file to $supervisor_pidfile
child_pidfile=$serverhome$serverid'server.pid'
echo Set child pid file to $child_pidfile
command="$winelocation $hdexecutable -cmd -exec ServerConfigs\\${serverid}.cfg"
echo Killing existing server
if (test -e $supervisor_pidfile)
then
kill -s TERM `cat $supervisor_pidfile`
fi
sleep 1
if (test -e $child_pidfile)
then
kill -s TERM `cat $child_pidfile`
fi
sleep 2
/usr/sbin/daemon -R 5 -t ${serverid} -P ${supervisor_pidfile} -p ${child_pidfile} ${command}&
sleep 10
echo Server has been launched!
#!/usr/local/bin/bash
# Set the variables below
###################################################################
serverid='server1'
sessionname='FreeBSD Test (server1)'
port='11051'
password=''
adminpass='FreeBSD'
nummaps='12'
maxclients='6'
pointlimit='0'
roundlimit='5'
roundcount='0'
allowrespawn='1'
respawntime='5'
spawnprotection='5'
friendlyfire='1'
inversedamage='0'
warmup='5'
autoteambalance='0'
thirdpersonview='1'
fallingdmg='1'
allowvehicles='1'
maxping='0'
maxfreq='0'
maxinactivity='0'
voicechat='none'
autorestart='0'
coopdifficulty='2'
cooplives='6'
allowcrosshair='1'
teamlives='0'
configdir='/usr/home/server/.wine/drive_c/HD2/ServerConfigs/'
serverhome='/home/server/'
###################################################################
serverid=hd2server${serverid}
echo "sessionname \"$sessionname\"">${configdir}${serverid}.cfg
echo "domain internet">>${configdir}${serverid}.cfg
echo "dedicated 1">>${configdir}${serverid}.cfg
echo "port $port">>${configdir}${serverid}.cfg
echo "password \"$password\"">>${configdir}${serverid}.cfg
echo "adminpass \"$adminpass\"">>${configdir}${serverid}.cfg
echo "style Cooperative">>${configdir}${serverid}.cfg
echo "maxclients $maxclients">>${configdir}${serverid}.cfg
echo "pointlimit $pointlimit">>${configdir}${serverid}.cfg
echo "roundlimit $roundlimit">>${configdir}${serverid}.cfg
echo "roundcount $roundcount">>${configdir}${serverid}.cfg
echo "allowrespawn $allowrespawn">>${configdir}${serverid}.cfg
echo "respawntime $respawntime">>${configdir}${serverid}.cfg
echo "spawnprotection $spawnprotection">>${configdir}${serverid}.cfg
echo "friendlyfire $friendlyfire">>${configdir}${serverid}.cfg
echo "inversedamage $inversedamage">>${configdir}${serverid}.cfg
echo "warmup $warmup">>${configdir}${serverid}.cfg
echo "autoteambalance $autoteambalance">>${configdir}${serverid}.cfg
echo "3rdpersonview $thirdpersonview">>${configdir}${serverid}.cfg
echo "fallingdmg $fallingdmg">>${configdir}${serverid}.cfg
echo "allowvehicles $allowvehicles">>${configdir}${serverid}.cfg
echo "maxping $maxping">>${configdir}${serverid}.cfg
echo "maxfreq $maxfreq">>${configdir}${serverid}.cfg
echo "maxinactivity $maxinactivity">>${configdir}${serverid}.cfg
echo "voicechat $voicechat">>${configdir}${serverid}.cfg
echo "autorestart $autorestart">>${configdir}${serverid}.cfg
echo "coopdifficulty $coopdifficulty">>${configdir}${serverid}.cfg
echo "cooplives $cooplives">>${configdir}${serverid}.cfg
echo "allowcrosshair $allowcrosshair">>${configdir}${serverid}.cfg
echo "teamlives $teamlives">>${configdir}${serverid}.cfg
coopmaps=("Ac(Complex)D")
coopmaps+=("Ac(Complex)N")
coopmaps+=("Ac(Complex)N")
coopmaps+=("Ac1(Ext)Day")
#coopmaps+=("Ac1(Ext)Night")
coopmaps+=("Ac1(First_Strike)")
#coopmaps+=("Ac1(Race)")
coopmaps+=("Ac3(The_Factory)")
coopmaps+=("Ac4(Convoy)")
coopmaps+=("Ac4(Radiocamp)")
coopmaps+=("Ad1(Last_Assault)")
coopmaps+=("Ad1(Snowcamp)")
coopmaps+=("Ad1(Tanks)")
coopmaps+=("Ad2(Liege)")
coopmaps+=("Af1(Airfield)")
coopmaps+=("Af1(Battlefield)")
coopmaps+=("Af1(Defence)")
coopmaps+=("Af1(Delivery)")
coopmaps+=("Af1(Grant)")
coopmaps+=("Af1(Tankbattle)B")
coopmaps+=("Af2(Rommels_Road)")
#coopmaps+=("Af3(Bot-Race)")
coopmaps+=("Af3(Oasis)")
coopmaps+=("Af3(Turnover)")
#coopmaps+=("Af4(Oasis)")
#coopmaps+=("Af4(Turnover)")
coopmaps+=("Af5(Art_Of_Sand)")
coopmaps+=("Af5(Stealth_of_Sand)")
coopmaps+=("Africa1")
coopmaps+=("Africa2")
coopmaps+=("Africa3")
#coopmaps+=("Africa4")
coopmaps+=("Africa5")
coopmaps+=("Al1(Fatal_Airdrop)")
coopmaps+=("Al1(Rendezvous)1")
coopmaps+=("Al1(Rendezvous)1E")
coopmaps+=("Al1(Rendezvous)2")
coopmaps+=("Al1(Rendezvous)3")
coopmaps+=("Al2(Hunedoara)")
coopmaps+=("Al3(Oddball)")
coopmaps+=("Alps1")
coopmaps+=("Alps2")
coopmaps+=("Arctic1")
coopmaps+=("Arctic2")
coopmaps+=("Arctic3")
coopmaps+=("Arctic4")
coopmaps+=("Ardennes1")
coopmaps+=("Bg1(Broken_Arrow_TLC)")
coopmaps+=("Bg1(Broken_Arrow)")
coopmaps+=("Bg2(Farmstead)")
coopmaps+=("Bg3(Escape_from_Hell)")
coopmaps+=("Bg3(Rescue_from_Hell)")
coopmaps+=("Bm1(Keyguard)")
coopmaps+=("Bm1(Night-Attack)")
coopmaps+=("Bm1(Nightwing)")
coopmaps+=("Bm2(Kingslayer)")
coopmaps+=("Br(Blitz)")
coopmaps+=("Br(Extended)")
coopmaps+=("Br(Gestopo)")
coopmaps+=("Br(Silent-Op)")
coopmaps+=("Brest")
coopmaps+=("Burgundy1")
coopmaps+=("Burgundy2")
coopmaps+=("Burgundy3")
coopmaps+=("Burma1")
coopmaps+=("Burma2")
coopmaps+=("Cz1(Train)")
coopmaps+=("Cz1(Trebissky)")
coopmaps+=("Cz3(Lumbermill)")
coopmaps+=("Cz3(Lumbermill)2")
coopmaps+=("Cz3(Ostwind)")
coopmaps+=("Cz4(Ambush)")
coopmaps+=("Cz4(Hart's_War)")
coopmaps+=("Cz4(Marketplace)")
coopmaps+=("Cz4(Resistance)")
coopmaps+=("Cz4(Trapped)")
coopmaps+=("Cz4(Village)")
#coopmaps+=("Cz5(Resistance)")
#coopmaps+=("Cz5(Trapped)")
#coopmaps+=("Cz5(Village)")
coopmaps+=("Cz6(Bunker)")
coopmaps+=("Cz6(Defence)")
coopmaps+=("Cz6(Final_Assault)")
coopmaps+=("Cz6(Iron_Swarm)")
coopmaps+=("Czech1")
coopmaps+=("Czech2")
coopmaps+=("Czech3")
coopmaps+=("Czech4")
#coopmaps+=("Czech5")
coopmaps+=("Czech6")
coopmaps+=("Li1(Day)")
coopmaps+=("Li1(Dherna)")
coopmaps+=("Li1(Hells_Gate)")
coopmaps+=("Li1(PrisonBreak)")
coopmaps+=("Li1(Sidi_Badullah)")
coopmaps+=("Li1(Supercharge)")
coopmaps+=("Li2(Tankbite)")
coopmaps+=("Li2(Tiger_Tomb)")
coopmaps+=("Li3(Blowout)")
coopmaps+=("Li3(Jailbreak)")
coopmaps+=("Li3(Littorio)")
coopmaps+=("Li3(Scorpio)")
coopmaps+=("Libya1")
coopmaps+=("Libya2")
coopmaps+=("Libya2b")
coopmaps+=("Libya3")
coopmaps+=("Nm2(Bait)")
coopmaps+=("Nm2(Firefly)")
coopmaps+=("Nm2(Frontline)")
#coopmaps+=("Nm2(Marolles)")
coopmaps+=("Nm2(Resistance)")
coopmaps+=("Nm2(Saving_Private_Smith)")
coopmaps+=("Nm3(Bridge)")
coopmaps+=("Nm4(HantaYo)")
coopmaps+=("Normandy1")
coopmaps+=("Normandy2")
coopmaps+=("Norway")
coopmaps+=("Pl(EnemyHQ)")
#coopmaps+=("Si1(NightAttack)")
coopmaps+=("Si2_A2")
coopmaps+=("Si2(Boom)")
coopmaps+=("Si2(Boom2)")
coopmaps+=("Si2(Delivery2)")
coopmaps+=("Si2(Mafia_Deal)")
coopmaps+=("Si2(Stormbridge)")
coopmaps+=("Sicily1")
coopmaps+=("Sicily2")
coopmaps+=("Tu(Great-Battle)")
# create maplist array
maplist=()
i=0
while [ $i -lt $nummaps ]; do
# pick a random number between 1 and the length of the indices array
rand=$(( RANDOM % ${#coopmaps[@]} ))
echo "mapname ${coopmaps[$rand]}" >> ${configdir}${serverid}.cfg
unset "coopmaps[$rand]"
coopmaps=(${coopmaps[@]})
i=$((i+1))
done
echo "server">>${configdir}${serverid}.cfg
#!/bin/sh
/bin/sh ~/server1.sh
sleep 5
/bin/sh ~/server2.sh
sleep 5
/bin/sh ~/server3.sh
sleep 5
/bin/sh ~/server4.sh
#launch the servers twice because fomr unknown reason (bug?) the first instance of /usr/sbin/daemon doesn't monitor the process properly
sleep 5
/bin/sh ~/server1.sh
sleep 5
/bin/sh ~/server2.sh
sleep 5
/bin/sh ~/server3.sh
sleep 5
/bin/sh ~/server4.sh
exit 0
#!/bin/sh
kill -s TERM `pgrep -f daemon.*hd2server.*[[]`
exit 0
#!/usr/local/bin/bash
/usr/local/bin/bash ~/createconfig1.sh
/usr/local/bin/bash ~/createconfig2.sh
/usr/local/bin/bash ~/createconfig3.sh
/usr/local/bin/bash ~/createconfig4.sh
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.