This commit is contained in:
iceBear67
2026-07-05 13:49:09 +08:00
parent a37aece686
commit bf67b8b95f
21 changed files with 230 additions and 61 deletions

View File

@@ -2,8 +2,6 @@
set -eo pipefail
hasunset=0
if [ "$UID" != "0" ]; then
echo "This script must be run in root."
exit 2
@@ -16,29 +14,11 @@ fi
PATH="$PWD/scripts:$PATH"
if [[ "$CLOUD_CONFIG_REPO" -eq "" ]]; then
echo "CLOUD_CONFIG_REPO is not set."
CLOUD_CONFIG_REPO="https://git.sfclub.cc/cloud/bearnet"
hasunset=1
fi
validate.sh
if [[ "$CLOUD_CONFIG_REVISION" -eq "" ]]; then
echo "CLOUD_CONFIG_REVISION is not set."
CLOUD_CONFIG_REVISION="wish"
hasunset=1
fi
if [[ "$CLOUD_GATEWAY_ADDRESS" -eq "" ]]; then
echo "CLOUD_GATEWAY_ADDRESS is not set."
CLOUD_GATEWAY_ADDRESS="10.0.0.119"
hasunset=1
fi
if [[ "$hasunset" -ne 0 ]]; then
echo ""
echo "Default values will be used for unset environments:"
echo ""
set | grep -E "^CLOUD_"
if [[ "$?" != "0" ]]; then
echo "env validation failed"
exit 1
fi
IMAGE_TAG=$(git rev-parse --short HEAD)