-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
455 additions
and
205 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 |
---|---|---|
@@ -1,18 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ `whoami` != "steam" ]; then | ||
exec gosu steam $0 "$@" | ||
if [ `whoami` != "$STEAM_USER" ]; then | ||
exec gosu $STEAM_USER $0 "$@" | ||
fi | ||
|
||
# TODO here we are going to trap the signals | ||
|
||
cd $DST_HOME/bin | ||
|
||
# We must have at least one writer | ||
sleep infinity > $DSTA_HOME/console & | ||
|
||
cd $DST_HOME/bin | ||
exec ./dontstarve_dedicated_server_nullrenderer \ | ||
-console \ | ||
-persistent_storage_root `dirname $CONFIG_PATH` \ | ||
-conf_dir `basename $CONFIG_PATH` \ | ||
"$@" < $DSTA_HOME/console | ||
-backup_logs \ | ||
-persistent_storage_root `dirname $CLUSTER_PATH` \ | ||
-conf_dir "." \ | ||
-cluster `basename $CLUSTER_PATH` \ | ||
-shard "$SHARD_NAME" \ | ||
"$@" < <({ stdbuf -oL cat $DSTA_HOME/console & stdbuf -oL cat & }) |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ `whoami` != "steam" ]; then | ||
exec gosu steam $0 "$@" | ||
if [ `whoami` != "$STEAM_USER" ]; then | ||
exec gosu $STEAM_USER $0 "$@" | ||
fi | ||
|
||
$STEAM_HOME/steamcmd.sh "$@" |
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,42 @@ | ||
warning(){ | ||
echo "[WARNING] $1" 1>&2 | ||
} | ||
|
||
validate_bool(){ | ||
local v=${!1} | ||
if [[ -n "$v" ]] && [[ "$v" != "true" ]] && [[ "$v" != "false" ]]; then | ||
warning "$1 must be \"true\" or \"false\"." | ||
return 1 | ||
fi | ||
} | ||
|
||
validate_int(){ | ||
local v=${!1} | ||
if [[ -n "$v" ]] && [[ "$v" -lt "$2" ]] || [[ "$v" -gt "$3" ]]; then | ||
warning "$1 must be between $2 and $3." | ||
return 1 | ||
fi | ||
} | ||
|
||
validate_port(){ | ||
return `validate_int "$1" "1" "65535"` | ||
} | ||
|
||
# http://stackoverflow.com/a/8574392/842697 | ||
containsElement(){ | ||
local e | ||
for e in "${@:2}"; do [[ "$e" == "$1" ]] && return 0; done | ||
return 1 | ||
} | ||
|
||
validate_option(){ | ||
local v=${!1} | ||
if [[ -n "$v" ]] && ! containsElement "$v" "${@:2}"; then | ||
warning "$1 must be one of these: ${*:2}." | ||
return 1 | ||
fi | ||
} | ||
|
||
conf() { | ||
[[ -n "$2" ]] && echo "$1 = $2" | ||
} |
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 |
---|---|---|
@@ -1,21 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
gosu steam mkdir "$CONFIG_PATH/save" | ||
|
||
create_list(){ | ||
list=$1 | ||
file=$2 | ||
if [ -n "$list" ] && [ ! -f $file ]; then | ||
echo $list | tr , '\n' > $file | ||
chown steam:steam $file | ||
chown $STEAM_USER:$STEAM_USER $file | ||
fi | ||
} | ||
|
||
# Create the adminlist.txt file. | ||
create_list "$ADMINLIST" "$CONFIG_PATH/save/adminlist.txt" | ||
create_list "$ADMINLIST" "$CLUSTER_PATH/adminlist.txt" | ||
|
||
# Create the whitelist.txt file. | ||
create_list "$WHITELIST" "$CONFIG_PATH/save/whitelist.txt" | ||
create_list "$WHITELIST" "$CLUSTER_PATH/whitelist.txt" | ||
|
||
# Create the blocklist.txt file. | ||
create_list "$BLOCKLIST" "$CONFIG_PATH/save/blocklist.txt" | ||
create_list "$BLOCKLIST" "$CLUSTER_PATH/blocklist.txt" |
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
Oops, something went wrong.