15 lines
457 B
Bash
15 lines
457 B
Bash
#!/bin/bash
|
|
|
|
echo "---Starting WireGuard tunnel wg${WG_CONFIG_ID}---"
|
|
sudo wg-quick up wg${WG_CONFIG_ID} > /dev/null 2>&1
|
|
EXIT_STATUS=$?
|
|
|
|
if [ "${EXIT_STATUS}" != 0 ]; then
|
|
echo "---Can't start WireGuard tunnel wg${WG_CONFIG_ID}, please check your config!---"
|
|
else
|
|
echo "---WireGuard tunnel wg${WG_CONFIG_ID} started successfully...---"
|
|
if [ "${ENABLE_WEBCONSOLE}" == "true" ]; then
|
|
/opt/scripts/start-gotty.sh 2>/dev/null &
|
|
fi
|
|
fi
|
|
sleep infinity |