mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2026-01-01 22:26:17 +00:00
31 lines
713 B
Bash
31 lines
713 B
Bash
|
|
#!/bin/bash
|
||
|
|
set -e
|
||
|
|
|
||
|
|
# Set Timezone
|
||
|
|
if [ -n "$TZ" ]; then
|
||
|
|
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||
|
|
fi
|
||
|
|
|
||
|
|
# Check required variables
|
||
|
|
if [ -z "$MASTER_SERVER_ADDRESS" ]; then
|
||
|
|
echo "ERROR: MASTER_SERVER_ADDRESS is not set."
|
||
|
|
exit 1
|
||
|
|
fi
|
||
|
|
|
||
|
|
if [ -z "$TOKEN" ]; then
|
||
|
|
echo "ERROR: TOKEN is not set."
|
||
|
|
exit 1
|
||
|
|
fi
|
||
|
|
|
||
|
|
# Check MASTER_SERVER_ADDRESS for HTTPS
|
||
|
|
if [[ "$MASTER_SERVER_ADDRESS" != https://* ]]; then
|
||
|
|
if [[ "$MASTER_SERVER_ADDRESS" == http://192.168.* ]]; then
|
||
|
|
echo "Warning: Using HTTP only for development."
|
||
|
|
else
|
||
|
|
echo "ERROR: MASTER_SERVER_ADDRESS must start with https://. Received: $MASTER_SERVER_ADDRESS"
|
||
|
|
exit 1
|
||
|
|
fi
|
||
|
|
fi
|
||
|
|
|
||
|
|
exec "$@"
|