Mon Jun 22 2020
This commit is contained in:
parent
1b41756726
commit
6996eee772
304
SOURCES/kf2-srv
304
SOURCES/kf2-srv
@ -17,22 +17,23 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
declare -a DiffArray
|
declare -a DiffNames
|
||||||
declare -a WaveArray
|
declare -a WaveNames
|
||||||
declare -A ModeArray
|
declare -A ModeNames
|
||||||
|
declare -A MutNames
|
||||||
|
|
||||||
source /etc/steamcmd/steamcmd.conf
|
source /etc/steamcmd/steamcmd.conf
|
||||||
source /etc/kf2-srv/kf2-srv.conf
|
source /etc/kf2-srv/kf2-srv.conf
|
||||||
|
|
||||||
ScriptFullname=$(readlink -e "$0")
|
ScriptFullname=$(readlink -e "$0")
|
||||||
ScriptName=$(echo "$ScriptFullname" | awk -F '/' '{print $NF;}')
|
ScriptName=$(echo "$ScriptFullname" | awk -F '/' '{print $NF;}')
|
||||||
ScriptVersion="0.9.1"
|
readonly ScriptVersion="0.10.0"
|
||||||
|
|
||||||
# Constants. Don't change.
|
# Constants. Don't change.
|
||||||
AppServerNum="232130"
|
readonly AppServerNum="232130"
|
||||||
AppClientNum="232090"
|
readonly AppClientNum="232090"
|
||||||
StrangeConstUID="17825793"
|
readonly StrangeConstUID="17825793"
|
||||||
ServerBotLogin="srvbot"
|
readonly ServerBotLogin="srvbot"
|
||||||
|
|
||||||
function show_help ()
|
function show_help ()
|
||||||
{
|
{
|
||||||
@ -276,76 +277,95 @@ function delete_instance () # $*: [InstanceName[s]]
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_status_implementation_body () # $*: [InstanceName[s]]
|
function instance_status () # $1: InstanceName
|
||||||
{
|
{
|
||||||
for Instance in $InstanceList
|
local Instance="$1"
|
||||||
do
|
if ! instance_exists "$Instance"; then return 1; fi
|
||||||
if systemctl -q is-enabled $(service_name "$Instance"); then
|
if systemctl -q is-enabled $(service_name "$Instance"); then
|
||||||
local IsEnabled="enabled"
|
local IsEnabled="enabled"
|
||||||
else
|
|
||||||
local IsEnabled="disabled"
|
|
||||||
fi
|
|
||||||
if systemctl | grep $(service_name "$Instance") | grep -q 'running' ; then
|
|
||||||
local IsRuning="running"
|
|
||||||
else
|
|
||||||
local IsRuning="stopped"
|
|
||||||
fi
|
|
||||||
|
|
||||||
local Comment=$( multini -g "$InstanceConfigDir/$Instance/main.conf" '' "Comment")
|
|
||||||
local GamePort=$( multini -g "$InstanceConfigDir/$Instance/main.conf" '' "PortGame")
|
|
||||||
local WebAdminPort=$( multini -g "$InstanceConfigDir/$Instance/main.conf" '' "PortWeb")
|
|
||||||
local QueryPort=$( multini -g "$InstanceConfigDir/$Instance/main.conf" '' "PortQuery")
|
|
||||||
local GameType=$( multini -g "$InstanceConfigDir/$Instance/main.conf" '' "Game")
|
|
||||||
local GameLength=$( multini -g "$InstanceConfigDir/$Instance/main.conf" '' "Length")
|
|
||||||
local GameDifficulty=$( multini -g "$InstanceConfigDir/$Instance/main.conf" '' "Difficulty")
|
|
||||||
local Map=$( multini -g "$InstanceConfigDir/$Instance/main.conf" '' "Map")
|
|
||||||
local Args=$( multini -g "$InstanceConfigDir/$Instance/main.conf" '' "Args")
|
|
||||||
|
|
||||||
local DisplayGameType=${ModeArray[$GameType]}
|
|
||||||
local DisplayGameLength=${WaveArray[$GameLength]}
|
|
||||||
local DisplayDifficulty=${DiffArray[$GameDifficulty]}
|
|
||||||
|
|
||||||
if [[ -z "$DisplayGameType" ]]; then
|
|
||||||
DisplayGameType="$GameType"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$GameType" == 'KFGameContent.KFGameInfo_WeeklySurvival' || \
|
|
||||||
"$GameType" == 'KFGameContent.KFGameInfo_Endless' || \
|
|
||||||
"$GameType" == 'KFGameContent.KFGameInfo_VersusSurvival' || \
|
|
||||||
"$GameType" == 'KFGameContent.KFGameInfo_Objective' ]]; then
|
|
||||||
DisplayGameLength='-'
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$GameType" == 'KFGameContent.KFGameInfo_WeeklySurvival' || \
|
|
||||||
"$DisplayGameType" == 'KFGameContent.KFGameInfo_VersusSurvival' ]]; then
|
|
||||||
DisplayDifficulty='-'
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -e "$Instance:$IsEnabled:$IsRuning:$GamePort:$QueryPort:$WebAdminPort:$DisplayGameType:$DisplayGameLength:$DisplayDifficulty:$Args:$Comment"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
function show_status_implementation_full () # $*: [InstanceName[s]]
|
|
||||||
{
|
|
||||||
local InstanceList=""
|
|
||||||
if [[ -z "$*" ]] ; then
|
|
||||||
InstanceList=$(show_instances)
|
|
||||||
else
|
else
|
||||||
for Instance in $*
|
local IsEnabled="disabled"
|
||||||
do
|
fi
|
||||||
if instance_exists "$Instance"; then
|
if systemctl | grep $(service_name "$Instance") | grep -q 'running' ; then
|
||||||
InstanceList+=" $Instance"
|
local IsRuning="running"
|
||||||
fi
|
else
|
||||||
done
|
local IsRuning="stopped"
|
||||||
|
fi
|
||||||
|
local Comment=$( multini -g "$InstanceConfigDir/$Instance/main.conf" '' "Comment")
|
||||||
|
local GamePort=$( multini -g "$InstanceConfigDir/$Instance/main.conf" '' "PortGame")
|
||||||
|
local WebAdminPort=$( multini -g "$InstanceConfigDir/$Instance/main.conf" '' "PortWeb")
|
||||||
|
local QueryPort=$( multini -g "$InstanceConfigDir/$Instance/main.conf" '' "PortQuery")
|
||||||
|
local GameType=$( multini -g "$InstanceConfigDir/$Instance/main.conf" '' "Game")
|
||||||
|
local GameLength=$( multini -g "$InstanceConfigDir/$Instance/main.conf" '' "Length")
|
||||||
|
local GameDifficulty=$( multini -g "$InstanceConfigDir/$Instance/main.conf" '' "Difficulty")
|
||||||
|
local Map=$( multini -g "$InstanceConfigDir/$Instance/main.conf" '' "Map")
|
||||||
|
local Mutators=$( multini -g "$InstanceConfigDir/$Instance/main.conf" '' "Mutators")
|
||||||
|
local Args=$( multini -g "$InstanceConfigDir/$Instance/main.conf" '' "Args")
|
||||||
|
|
||||||
|
local DisplayGameType=''
|
||||||
|
local DisplayGameLength=''
|
||||||
|
local DisplayDifficulty=''
|
||||||
|
local DisplayMutators=''
|
||||||
|
|
||||||
|
for Mutator in ${Mutators//,/ }
|
||||||
|
do
|
||||||
|
local MutName=${MutNames[$Mutator]}
|
||||||
|
if [[ -z "$MutName" ]]; then
|
||||||
|
MutName="$Mutator"
|
||||||
|
fi
|
||||||
|
if [[ -z "$DisplayMutators" ]]; then
|
||||||
|
DisplayMutators="$MutName"
|
||||||
|
else
|
||||||
|
DisplayMutators="$DisplayMutators, $MutName"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ -n "$GameType" ]]; then DisplayGameType=${ModeNames[$GameType]} ; fi
|
||||||
|
if [[ -n "$GameLength" ]]; then DisplayGameLength=${WaveNames[$GameLength]} ; fi
|
||||||
|
if [[ -n "$GameDifficulty" ]]; then DisplayDifficulty=${DiffNames[$GameDifficulty]} ; fi
|
||||||
|
|
||||||
|
if [[ -z "$DisplayMutators" ]] && [[ -z "$Mutators" ]]; then
|
||||||
|
DisplayMutators='-'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "INSTANCE:AUTORUN:STATE:P_GAME:P_QUERY:P_WEB:TYPE:LEN:DIFF:ARGS:COMMENT"
|
if [[ -z "$DisplayGameType" ]]; then
|
||||||
show_status_implementation_body "$InstanceList" | sort -t : -k 4
|
DisplayGameType="$GameType"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$Args" ]]; then
|
||||||
|
Args='-'
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$GameType" == 'KFGameContent.KFGameInfo_WeeklySurvival' || \
|
||||||
|
"$GameType" == 'KFGameContent.KFGameInfo_Endless' || \
|
||||||
|
"$GameType" == 'KFGameContent.KFGameInfo_VersusSurvival' || \
|
||||||
|
"$GameType" == 'KFGameContent.KFGameInfo_Objective' ]]; then
|
||||||
|
DisplayGameLength='-'
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$GameType" == 'KFGameContent.KFGameInfo_WeeklySurvival' || \
|
||||||
|
"$DisplayGameType" == 'KFGameContent.KFGameInfo_VersusSurvival' ]]; then
|
||||||
|
DisplayDifficulty='-'
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "$Instance:$IsEnabled:$IsRuning:$GamePort:$QueryPort:$WebAdminPort:$DisplayGameType:$DisplayGameLength:$DisplayDifficulty:$DisplayMutators:$Args:$Comment"
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_status () # $*: [InstanceName[s]]
|
function show_status () # $*: [InstanceName[s]]
|
||||||
{
|
{
|
||||||
show_status_implementation_full $* | column -t -s :
|
{
|
||||||
|
echo -e "INSTANCE:AUTORUN:STATE:P_GAME:P_QUERY:P_WEB:TYPE:LEN:DIFF:MUTATORS:ARGS:COMMENT"
|
||||||
|
{
|
||||||
|
local InstanceList="$*"
|
||||||
|
if [[ -z "$*" ]] ; then
|
||||||
|
InstanceList=$(show_instances)
|
||||||
|
fi
|
||||||
|
for Instance in $InstanceList
|
||||||
|
do
|
||||||
|
instance_status "$Instance"
|
||||||
|
done
|
||||||
|
} | sort -t : -k 4
|
||||||
|
} | column -t -s :
|
||||||
}
|
}
|
||||||
|
|
||||||
function validate ()
|
function validate ()
|
||||||
@ -708,47 +728,43 @@ function name_by_workshopID () # $1: WorkshopID
|
|||||||
echo "$Result"
|
echo "$Result"
|
||||||
}
|
}
|
||||||
|
|
||||||
function workshop_list_body () # $1: WorkshopListFile
|
function workshop_list_ids ()
|
||||||
{
|
{
|
||||||
while read WorkshopID
|
local WsList=''
|
||||||
do
|
|
||||||
local Cache="$CacheDir/$WorkshopID"
|
|
||||||
local Downl="$DownloadDir/$WorkshopID"
|
|
||||||
local Url="https://steamcommunity.com/sharedfiles/filedetails/?id=$WorkshopID"
|
|
||||||
local WsName=$(name_by_workshopID "$WorkshopID")
|
|
||||||
if [[ -n "$WsName" ]]; then
|
|
||||||
local WsSize=$(du -sch "$Downl" "$Cache" | tail -n 1 | grep -Po '^[^\s]+')
|
|
||||||
else
|
|
||||||
local WsSize="-"; WsName="-"
|
|
||||||
fi
|
|
||||||
echo "$WorkshopID $WsName $WsSize $Url"
|
|
||||||
done < "$1"
|
|
||||||
}
|
|
||||||
|
|
||||||
function workshop_list_full () # $1: WorkshoplistFile
|
|
||||||
{
|
|
||||||
echo "WORKSHOP_ID NAME SIZE WORKSHOP_URL"
|
|
||||||
workshop_list_body "$1" | sort -k 2
|
|
||||||
}
|
|
||||||
|
|
||||||
function workshop_list () # $1: [--human-readable]
|
|
||||||
{
|
|
||||||
# TODO: Multiple *.kfm/*u in folder
|
|
||||||
local WsList=$(mktemp)
|
|
||||||
for Instance in $(show_instances)
|
for Instance in $(show_instances)
|
||||||
do
|
do
|
||||||
local Config="$InstanceConfigDir/$Instance/LinuxServer-KFEngine.ini"
|
local Config="$InstanceConfigDir/$Instance/LinuxServer-KFEngine.ini"
|
||||||
if multini -gq "$Config" "OnlineSubsystemSteamworks.KFWorkshopSteamworks" "ServerSubscribedWorkshopItems"; then
|
if multini -gq "$Config" "OnlineSubsystemSteamworks.KFWorkshopSteamworks" "ServerSubscribedWorkshopItems"; then
|
||||||
multini -g "$Config" "OnlineSubsystemSteamworks.KFWorkshopSteamworks" "ServerSubscribedWorkshopItems" >> "$WsList"
|
if [[ -n "$WsList" ]]; then
|
||||||
|
WsList+=$'\n'
|
||||||
|
fi
|
||||||
|
WsList+=$(multini -g "$Config" "OnlineSubsystemSteamworks.KFWorkshopSteamworks" "ServerSubscribedWorkshopItems")
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
sort -u "$WsList" -o "$WsList"
|
echo "$WsList" | sort -V -u
|
||||||
if [[ -n "$1" ]]; then
|
}
|
||||||
workshop_list_full "$WsList" | column -t
|
|
||||||
else
|
function workshop_list ()
|
||||||
cat "$WsList"
|
{
|
||||||
fi
|
# TODO: Multiple *.kfm/*u in folder
|
||||||
rm -f "$WsList"
|
{
|
||||||
|
echo "WORKSHOP_ID NAME SIZE WORKSHOP_URL"
|
||||||
|
{
|
||||||
|
for WorkshopID in $(workshop_list_ids)
|
||||||
|
do
|
||||||
|
local Cache="$CacheDir/$WorkshopID"
|
||||||
|
local Downl="$DownloadDir/$WorkshopID"
|
||||||
|
local Url="https://steamcommunity.com/sharedfiles/filedetails/?id=$WorkshopID"
|
||||||
|
local WsName=$(name_by_workshopID "$WorkshopID")
|
||||||
|
if [[ -n "$WsName" ]]; then
|
||||||
|
local WsSize=$(du -sch "$Downl" "$Cache" | tail -n 1 | grep -Po '^[^\s]+')
|
||||||
|
else
|
||||||
|
local WsSize="-"; WsName="-"
|
||||||
|
fi
|
||||||
|
echo "$WorkshopID $WsName $WsSize $Url"
|
||||||
|
done
|
||||||
|
} | sort -k 2
|
||||||
|
} | column -t
|
||||||
}
|
}
|
||||||
|
|
||||||
function any_to_workshopID () # $1: WorkshopID/URL
|
function any_to_workshopID () # $1: WorkshopID/URL
|
||||||
@ -806,7 +822,7 @@ $Downl"
|
|||||||
|
|
||||||
function workshop_sync ()
|
function workshop_sync ()
|
||||||
{
|
{
|
||||||
workshop_add $(workshop_list)
|
workshop_add $(workshop_list_ids)
|
||||||
|
|
||||||
# TODO: Make it faster
|
# TODO: Make it faster
|
||||||
for Instance in $(show_instances)
|
for Instance in $(show_instances)
|
||||||
@ -943,40 +959,39 @@ function steamID64_to_steamID3 () # $1: ID4
|
|||||||
echo "$ID3"
|
echo "$ID3"
|
||||||
}
|
}
|
||||||
|
|
||||||
function ban_list_ext () # $1: BanlistFile
|
function ban_list_id3 ()
|
||||||
{
|
{
|
||||||
local Num=1
|
local BanList=''
|
||||||
echo "NUM STEAM_ID3 STEAM_ID64 URL_CONST URL_EFFECTIVE"
|
|
||||||
while read ID3
|
|
||||||
do
|
|
||||||
local ID64=$(steamID3_to_steamID64 "$ID3")
|
|
||||||
local UrlConst="https://steamcommunity.com/profiles/$ID64"
|
|
||||||
local UrlEffective=$(curl "$UrlConst" -s -L -I -o /dev/null -w '%{url_effective}')
|
|
||||||
if [[ "$UrlConst" == "$UrlEffective" ]]; then
|
|
||||||
UrlEffective="-"
|
|
||||||
fi
|
|
||||||
echo "$Num $ID3 $ID64 $UrlConst $UrlEffective"
|
|
||||||
((Num++))
|
|
||||||
done < "$1"
|
|
||||||
}
|
|
||||||
|
|
||||||
function ban_list () # $1: [--human-readable]
|
|
||||||
{
|
|
||||||
local BanList=$(mktemp)
|
|
||||||
for Instance in $(show_instances)
|
for Instance in $(show_instances)
|
||||||
do
|
do
|
||||||
local Config="$InstanceConfigDir/$Instance/LinuxServer-KFGame.ini"
|
local Config="$InstanceConfigDir/$Instance/LinuxServer-KFGame.ini"
|
||||||
if multini -gq "$Config" "Engine.AccessControl" "BannedIDs"; then
|
if multini -gq "$Config" "Engine.AccessControl" "BannedIDs"; then
|
||||||
multini -g "$Config" "Engine.AccessControl" "BannedIDs" | sed -r 's/.+A=([0-9]+),.+/\1/' >> "$BanList"
|
if [[ -n "$BanList" ]]; then
|
||||||
|
BanList+=$'\n'
|
||||||
|
fi
|
||||||
|
BanList+=$(multini -g "$Config" "Engine.AccessControl" "BannedIDs" | sed -r 's/.+A=([0-9]+),.+/\1/')
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
sort -u "$BanList" -o "$BanList"
|
echo "$BanList" | sort -V -u
|
||||||
if [[ -n "$1" ]]; then
|
}
|
||||||
ban_list_ext "$BanList" | column -t
|
|
||||||
else
|
function ban_list () # $1: [--human-readable]
|
||||||
cat "$BanList"
|
{
|
||||||
fi
|
{
|
||||||
rm -f "$BanList"
|
local Num=1
|
||||||
|
echo "NUM STEAM_ID3 STEAM_ID64 URL_CONST URL_EFFECTIVE"
|
||||||
|
for ID3 in $(ban_list_id3)
|
||||||
|
do
|
||||||
|
local ID64=$(steamID3_to_steamID64 "$ID3")
|
||||||
|
local UrlConst="https://steamcommunity.com/profiles/$ID64"
|
||||||
|
local UrlEffective=$(curl "$UrlConst" -s -L -I -o /dev/null -w '%{url_effective}')
|
||||||
|
if [[ "$UrlConst" == "$UrlEffective" ]]; then
|
||||||
|
UrlEffective="-"
|
||||||
|
fi
|
||||||
|
echo "$Num $ID3 $ID64 $UrlConst $UrlEffective"
|
||||||
|
((Num++))
|
||||||
|
done
|
||||||
|
} | column -t
|
||||||
}
|
}
|
||||||
|
|
||||||
function ban_ID3 () # $1: ID3
|
function ban_ID3 () # $1: ID3
|
||||||
@ -1011,11 +1026,20 @@ function unban_ID3 () # $1: ID3
|
|||||||
local BanStr="(Uid=(A=$ID3,B=$StrangeConstUID))"
|
local BanStr="(Uid=(A=$ID3,B=$StrangeConstUID))"
|
||||||
local Service=$(service_name "$Instance")
|
local Service=$(service_name "$Instance")
|
||||||
if systemctl -q is-active $Service ; then
|
if systemctl -q is-active $Service ; then
|
||||||
echo "Instance $Instance is running - skip."
|
local PlainID=0
|
||||||
# TODO: delete ban with webadmin/curl
|
while read Line
|
||||||
# POST Body example:
|
do
|
||||||
# banid=plainid%3A8&action=delete
|
if echo "$Line" | grep -qF "A=$ID3,"; then
|
||||||
# WTF is plainID?!
|
echo "Remove ban $ID3 from $Instance"
|
||||||
|
admin_curl "$Instance" "ServerAdmin/policy/bans" \
|
||||||
|
--request POST \
|
||||||
|
--data action="delete" \
|
||||||
|
--data banid="plainid:$PlainID"
|
||||||
|
break
|
||||||
|
else
|
||||||
|
((PlainID++))
|
||||||
|
fi
|
||||||
|
done < <(multini -g "$Config" 'Engine.AccessControl' 'BannedIDs')
|
||||||
else
|
else
|
||||||
if multini -gq "$Config" "Engine.AccessControl" "BannedIDs" "$BanStr"; then
|
if multini -gq "$Config" "Engine.AccessControl" "BannedIDs" "$BanStr"; then
|
||||||
echo "Remove ban $ID3 from $Instance"
|
echo "Remove ban $ID3 from $Instance"
|
||||||
@ -1069,7 +1093,7 @@ function ban_del () # $*: ban list
|
|||||||
|
|
||||||
function ban_sync ()
|
function ban_sync ()
|
||||||
{
|
{
|
||||||
ban_list | \
|
ban_list_id3 | \
|
||||||
while read ID3
|
while read ID3
|
||||||
do
|
do
|
||||||
ban_ID3 "$ID3"
|
ban_ID3 "$ID3"
|
||||||
@ -1214,13 +1238,13 @@ case $1 in
|
|||||||
-rs|--restart ) if [[ "$EUID" -eq 0 ]]; then shift; restart_instance $*; else run_as_root $*; fi ;;
|
-rs|--restart ) if [[ "$EUID" -eq 0 ]]; then shift; restart_instance $*; else run_as_root $*; fi ;;
|
||||||
-en|--enable ) if [[ "$EUID" -eq 0 ]]; then shift; enable_instance $*; else run_as_root $*; fi ;;
|
-en|--enable ) if [[ "$EUID" -eq 0 ]]; then shift; enable_instance $*; else run_as_root $*; fi ;;
|
||||||
-di|--disable ) if [[ "$EUID" -eq 0 ]]; then shift; disable_instance $*; else run_as_root $*; fi ;;
|
-di|--disable ) if [[ "$EUID" -eq 0 ]]; then shift; disable_instance $*; else run_as_root $*; fi ;;
|
||||||
-wl|--workshop-list ) if [[ "$EUID" -eq 0 ]]; then shift; workshop_list "-h" ; else run_as_root $*; fi ;;
|
-wl|--workshop-list ) if [[ "$EUID" -eq 0 ]]; then shift; workshop_list ; else run_as_root $*; fi ;;
|
||||||
-wa|--workshop-add ) if [[ "$EUID" -eq 0 ]]; then shift; workshop_add $*; else run_as_root $*; fi ;;
|
-wa|--workshop-add ) if [[ "$EUID" -eq 0 ]]; then shift; workshop_add $*; else run_as_root $*; fi ;;
|
||||||
-wd|--workshop-del ) if [[ "$EUID" -eq 0 ]]; then shift; workshop_del $*; else run_as_root $*; fi ;;
|
-wd|--workshop-del ) if [[ "$EUID" -eq 0 ]]; then shift; workshop_del $*; else run_as_root $*; fi ;;
|
||||||
-ws|--workshop-sync ) if [[ "$EUID" -eq 0 ]]; then shift; workshop_sync ; else run_as_root $*; fi ;;
|
-ws|--workshop-sync ) if [[ "$EUID" -eq 0 ]]; then shift; workshop_sync ; else run_as_root $*; fi ;;
|
||||||
-mrs|--map-rotate-save ) if [[ "$EUID" -eq 0 ]]; then shift; map_rotate_save $*; else run_as_root $*; fi ;;
|
-mrs|--map-rotate-save ) if [[ "$EUID" -eq 0 ]]; then shift; map_rotate_save $*; else run_as_root $*; fi ;;
|
||||||
-mrl|--map-rotate-load ) if [[ "$EUID" -eq 0 ]]; then shift; map_rotate_load $*; else run_as_root $*; fi ;;
|
-mrl|--map-rotate-load ) if [[ "$EUID" -eq 0 ]]; then shift; map_rotate_load $*; else run_as_root $*; fi ;;
|
||||||
-bl|--ban-list ) if [[ "$EUID" -eq 0 ]]; then shift; ban_list "-h" ; else run_as_root $*; fi ;;
|
-bl|--ban-list ) if [[ "$EUID" -eq 0 ]]; then shift; ban_list ; else run_as_root $*; fi ;;
|
||||||
-bs|--ban-sync ) if [[ "$EUID" -eq 0 ]]; then shift; ban_sync ; else run_as_root $*; fi ;;
|
-bs|--ban-sync ) if [[ "$EUID" -eq 0 ]]; then shift; ban_sync ; else run_as_root $*; fi ;;
|
||||||
-ba|--ban-add ) if [[ "$EUID" -eq 0 ]]; then shift; ban_add $*; else run_as_root $*; fi ;;
|
-ba|--ban-add ) if [[ "$EUID" -eq 0 ]]; then shift; ban_add $*; else run_as_root $*; fi ;;
|
||||||
-bd|--ban-del ) if [[ "$EUID" -eq 0 ]]; then shift; ban_del $*; else run_as_root $*; fi ;;
|
-bd|--ban-del ) if [[ "$EUID" -eq 0 ]]; then shift; ban_del $*; else run_as_root $*; fi ;;
|
||||||
|
@ -2,7 +2,21 @@
|
|||||||
Description=Check and Update Killing Floor 2 server
|
Description=Check and Update Killing Floor 2 server
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=oneshot
|
||||||
|
|
||||||
|
ExecStart=/usr/bin/kf2-srv-beta --chat 'Scheduled server restart at 4:00 (MSK)'
|
||||||
|
ExecStart=/usr/bin/kf2-srv-beta --chat 'Server will restart after 30 minutes'
|
||||||
|
ExecStart=/bin/sleep 15m
|
||||||
|
|
||||||
|
ExecStart=/usr/bin/kf2-srv-beta --chat 'Server will restart after 15 minutes'
|
||||||
|
ExecStart=/bin/sleep 10m
|
||||||
|
|
||||||
|
ExecStart=/usr/bin/kf2-srv-beta --chat 'Server will restart after 5 minutes'
|
||||||
|
ExecStart=/bin/sleep 5m
|
||||||
|
|
||||||
|
ExecStart=/usr/bin/kf2-srv-beta --chat 'Server shutting down...'
|
||||||
|
ExecStart=/bin/sleep 5s
|
||||||
|
|
||||||
ExecStart=/usr/bin/kf2-srv-beta --update
|
ExecStart=/usr/bin/kf2-srv-beta --update
|
||||||
|
|
||||||
PrivateTmp=true
|
PrivateTmp=true
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
Description=Check and Update killing Floor 2 beta job
|
Description=Check and Update killing Floor 2 beta job
|
||||||
|
|
||||||
[Timer]
|
[Timer]
|
||||||
OnCalendar=Wed, 04:00
|
OnCalendar=Wed, 03:30
|
||||||
Unit=kf2-srv-beta-update.service
|
Unit=kf2-srv-beta-update.service
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
@ -8,7 +8,7 @@ Type=simple
|
|||||||
StandardOutput=null
|
StandardOutput=null
|
||||||
StandardError=null
|
StandardError=null
|
||||||
EnvironmentFile=/etc/kf2-srv/instances-beta/%i/main.conf
|
EnvironmentFile=/etc/kf2-srv/instances-beta/%i/main.conf
|
||||||
ExecStart=/usr/games/kf2-srv-beta/Binaries/Win64/KFGameSteamServer.bin.x86_64 ${Map}?Difficulty=${Difficulty}?GameLength=${Length}?Game=${Game}${Args} configsubdir=instances/%i -webadminport=${PortWeb} -queryport=${PortQuery} -port=${PortGame}
|
ExecStart=/usr/games/kf2-srv-beta/Binaries/Win64/KFGameSteamServer.bin.x86_64 ${Map}?Difficulty=${Difficulty}?GameLength=${Length}?Game=${Game}?Mutator=${Mutators}?${Args} configsubdir=instances/%i -webadminport=${PortWeb} -queryport=${PortQuery} -port=${PortGame}
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|
||||||
NoNewPrivileges=yes
|
NoNewPrivileges=yes
|
||||||
|
@ -2,7 +2,21 @@
|
|||||||
Description=Check and Update Killing Floor 2 server
|
Description=Check and Update Killing Floor 2 server
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=oneshot
|
||||||
|
|
||||||
|
ExecStart=/usr/bin/kf2-srv --chat 'Scheduled server restart at 4:00 (MSK)'
|
||||||
|
ExecStart=/usr/bin/kf2-srv --chat 'Server will restart after 30 minutes'
|
||||||
|
ExecStart=/bin/sleep 15m
|
||||||
|
|
||||||
|
ExecStart=/usr/bin/kf2-srv --chat 'Server will restart after 15 minutes'
|
||||||
|
ExecStart=/bin/sleep 10m
|
||||||
|
|
||||||
|
ExecStart=/usr/bin/kf2-srv --chat 'Server will restart after 5 minutes'
|
||||||
|
ExecStart=/bin/sleep 5m
|
||||||
|
|
||||||
|
ExecStart=/usr/bin/kf2-srv --chat 'Server shutting down...'
|
||||||
|
ExecStart=/bin/sleep 5s
|
||||||
|
|
||||||
ExecStart=/usr/bin/kf2-srv --update
|
ExecStart=/usr/bin/kf2-srv --update
|
||||||
|
|
||||||
PrivateTmp=true
|
PrivateTmp=true
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
Description=Check and Update killing Floor 2 job
|
Description=Check and Update killing Floor 2 job
|
||||||
|
|
||||||
[Timer]
|
[Timer]
|
||||||
OnCalendar=Wed, 04:00
|
OnCalendar=Wed, 03:30
|
||||||
Unit=kf2-srv-update.service
|
Unit=kf2-srv-update.service
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
@ -1,17 +1,20 @@
|
|||||||
# Displays game difficulty
|
# Displays game difficulty
|
||||||
# You can rename them as you like
|
# You can rename them as you like
|
||||||
DiffArray=('Normal' 'Hard' 'Suicide' 'Hell')
|
DiffNames=('Normal' 'Hard' 'Suicide' 'Hell')
|
||||||
|
|
||||||
# Displays the number of waves
|
# Displays the number of waves
|
||||||
# You can rename them as you like
|
# You can rename them as you like
|
||||||
WaveArray=('4' '7' '10')
|
WaveNames=('4' '7' '10')
|
||||||
|
|
||||||
# Add custom gamemodes to the end of the list, similar to what is already there:
|
# Add custom gamemodes to the end of the list, similar to what is already there:
|
||||||
ModeArray['KFGameContent.KFGameInfo_Survival']='Survival'
|
ModeNames['KFGameContent.KFGameInfo_Survival']='Survival'
|
||||||
ModeArray['KFGameContent.KFGameInfo_WeeklySurvival']='Weekly'
|
ModeNames['KFGameContent.KFGameInfo_WeeklySurvival']='Weekly'
|
||||||
ModeArray['KFGameContent.KFGameInfo_Endless']='Endless'
|
ModeNames['KFGameContent.KFGameInfo_Endless']='Endless'
|
||||||
ModeArray['KFGameContent.KFGameInfo_Objective']='Objective'
|
ModeNames['KFGameContent.KFGameInfo_Objective']='Objective'
|
||||||
ModeArray['KFGameContent.KFGameInfo_VersusSurvival']='Versus'
|
ModeNames['KFGameContent.KFGameInfo_VersusSurvival']='Versus'
|
||||||
|
|
||||||
|
# Add mutators to the end of the list, similar to what is already there:
|
||||||
|
MutNames['ServerExtMut.ServerExtMut']='RPG'
|
||||||
|
|
||||||
# Bot default password
|
# Bot default password
|
||||||
# To change the password for the bot, you must do this here and in WebAdmin.
|
# To change the password for the bot, you must do this here and in WebAdmin.
|
||||||
|
@ -8,7 +8,7 @@ Type=simple
|
|||||||
StandardOutput=null
|
StandardOutput=null
|
||||||
StandardError=null
|
StandardError=null
|
||||||
EnvironmentFile=/etc/kf2-srv/instances/%i/main.conf
|
EnvironmentFile=/etc/kf2-srv/instances/%i/main.conf
|
||||||
ExecStart=/usr/games/kf2-srv/Binaries/Win64/KFGameSteamServer.bin.x86_64 ${Map}?Difficulty=${Difficulty}?GameLength=${Length}?Game=${Game}${Args} configsubdir=instances/%i -webadminport=${PortWeb} -queryport=${PortQuery} -port=${PortGame}
|
ExecStart=/usr/games/kf2-srv/Binaries/Win64/KFGameSteamServer.bin.x86_64 ${Map}?Difficulty=${Difficulty}?GameLength=${Length}?Game=${Game}?Mutator=${Mutators}?${Args} configsubdir=instances/%i -webadminport=${PortWeb} -queryport=${PortQuery} -port=${PortGame}
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|
||||||
NoNewPrivileges=yes
|
NoNewPrivileges=yes
|
||||||
|
@ -28,8 +28,10 @@ Game=KFGameContent.KFGameInfo_Endless
|
|||||||
# 10 waves: 2
|
# 10 waves: 2
|
||||||
Length=2
|
Length=2
|
||||||
|
|
||||||
|
# Mutators
|
||||||
|
Mutators=
|
||||||
|
|
||||||
# Additional parameters
|
# Additional parameters
|
||||||
# If the parameter is used, it must necessarily begin with a character '?'
|
|
||||||
Args=
|
Args=
|
||||||
|
|
||||||
# Notes for yourself
|
# Notes for yourself
|
||||||
|
@ -1,40 +1,40 @@
|
|||||||
%global steamuser steam
|
%global steamuser steam
|
||||||
|
|
||||||
Name: kf2-srv
|
Name: kf2-srv
|
||||||
Version: 0.9.1
|
Version: 0.10.0
|
||||||
Release: 1%{dist}
|
Release: 1%{dist}
|
||||||
Summary: Killing Floor 2 server
|
Summary: Killing Floor 2 server
|
||||||
Group: Amusements/Games
|
Group: Amusements/Games
|
||||||
License: GNU GPLv3
|
License: GNU GPLv3
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
Source1: %{name}
|
Source1: %{name}
|
||||||
Source2: %{name}-beta
|
Source2: %{name}-beta
|
||||||
Source3: %{name}.xml
|
Source3: %{name}.xml
|
||||||
Source4: %{name}@.service
|
Source4: %{name}@.service
|
||||||
Source5: %{name}-update.service
|
Source5: %{name}-update.service
|
||||||
Source6: %{name}-update.timer
|
Source6: %{name}-update.timer
|
||||||
Source7: main.conf.template
|
Source7: main.conf.template
|
||||||
Source8: %{name}-beta@.service
|
Source8: %{name}-beta@.service
|
||||||
Source9: %{name}-beta-update.service
|
Source9: %{name}-beta-update.service
|
||||||
Source10: %{name}-beta-update.timer
|
Source10: %{name}-beta-update.timer
|
||||||
Source11: %{name}.conf
|
Source11: %{name}.conf
|
||||||
|
|
||||||
Requires: systemd >= 219
|
Requires: systemd >= 219
|
||||||
Requires: steamcmd
|
Requires: steamcmd
|
||||||
Requires: libxml2
|
Requires: libxml2
|
||||||
Requires: dos2unix
|
Requires: dos2unix
|
||||||
Requires: curl
|
Requires: curl
|
||||||
Requires: grep
|
Requires: grep
|
||||||
Requires: coreutils
|
Requires: coreutils
|
||||||
Requires: sed
|
Requires: sed
|
||||||
Requires: util-linux
|
Requires: util-linux
|
||||||
Requires: sudo
|
Requires: sudo
|
||||||
Requires: psmisc
|
Requires: psmisc
|
||||||
Requires: gawk
|
Requires: gawk
|
||||||
Requires: multini >= 0.2.3
|
Requires: multini >= 0.2.3
|
||||||
|
|
||||||
Provides: %{name}
|
Provides: %{name}
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Command line tool for managing a set of Killing Floor 2 servers.
|
Command line tool for managing a set of Killing Floor 2 servers.
|
||||||
@ -95,6 +95,13 @@ if [[ $1 -eq 0 ]] ; then # Uninstall
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Jun 22 2020 GenZmeY <genzmey@gmail.com> - 0.10.0-1
|
||||||
|
- separate mutators setting;
|
||||||
|
- mutator column in server list;
|
||||||
|
- chat notifications on restart for updates;
|
||||||
|
- unban on working servers;
|
||||||
|
- refactoring.
|
||||||
|
|
||||||
* Sun May 31 2020 GenZmeY <genzmey@gmail.com> - 0.9.1-1
|
* Sun May 31 2020 GenZmeY <genzmey@gmail.com> - 0.9.1-1
|
||||||
- fix realtime -mrl with spaces;
|
- fix realtime -mrl with spaces;
|
||||||
- mapcycles directory.
|
- mapcycles directory.
|
||||||
|
Loading…
Reference in New Issue
Block a user