2019-07-04 00:34:09 +02:00
|
|
|
#!/bin/bash
|
2019-07-06 16:17:03 +02:00
|
|
|
set -eou pipefail
|
2019-07-04 00:34:09 +02:00
|
|
|
|
|
|
|
if [[ -f /run/secrets/username ]]; then
|
|
|
|
USERNAME=$(cat /run/secrets/username)
|
|
|
|
fi
|
|
|
|
|
2020-09-26 13:53:48 +02:00
|
|
|
if [[ -f /run/secrets/token ]]; then
|
2019-07-04 00:34:09 +02:00
|
|
|
TOKEN=$(cat /run/secrets/token)
|
|
|
|
fi
|
|
|
|
|
2019-07-06 16:45:38 +02:00
|
|
|
if [[ -z ${USERNAME:-} ]]; then
|
|
|
|
USERNAME="$(jq -j ".username" "$CONFIG/server-settings.json")"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -z ${TOKEN:-} ]]; then
|
|
|
|
TOKEN="$(jq -j ".token" "$CONFIG/server-settings.json")"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -z ${USERNAME:-} ]]; then
|
|
|
|
echo "You need to provide your Factorio username to update mods."
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -z ${TOKEN:-} ]]; then
|
|
|
|
echo "You need to provide your Factorio token to update mods."
|
2019-07-04 00:34:09 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
./update-mods.sh "$VERSION" "$MODS" "$USERNAME" "$TOKEN"
|