-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add command to load specific prospect
docs: added missing update_cron environment to list
- Loading branch information
1 parent
25af5a8
commit 95f09a0
Showing
5 changed files
with
79 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
. "$(dirname "$0")/common" | ||
. "$(dirname "$0")/defaults" | ||
|
||
loadProspect() { | ||
local prospectName=${@:2} | ||
|
||
if [[ -z "$prospectName" ]]; then | ||
warn "No prospect name provided. Skip server restart." | ||
return | ||
fi | ||
|
||
if [[ ! -f "${data_path}/Saved/PlayerData/DedicatedServer/Prospects/${prospectName}.json" ]]; then | ||
warn "Prospect ${prospectName} does not exist. Skip server restart." | ||
return | ||
fi | ||
|
||
info "Loading prospect $prospectName" | ||
supervisorctl stop icarus-server | ||
echo sed -i "/LoadProspect=/c\LoadProspect=${prospectName}" ${config_path}/ServerSettings.ini | ||
sed -i "/LoadProspect=/c\LoadProspect=${prospectName}" ${config_path}/ServerSettings.ini | ||
supervisorctl start icarus-server | ||
} | ||
|
||
main() { | ||
local command=$1 | ||
|
||
case $command in | ||
loadProspect) | ||
loadProspect $@ | ||
;; | ||
*) | ||
info "Usage: $0 loadProspect <prospectName>" | ||
exit 1 | ||
esac | ||
} | ||
|
||
main $@ |