mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-20 06:07:57 +00:00
03ec97ab8d
Change-Type: minor
17 lines
499 B
Bash
Executable File
17 lines
499 B
Bash
Executable File
#!/bin/bash
|
|
source /usr/src/app/resin-vars
|
|
sed --expression="s/#{VPN_ENDPOINT}/${VPN_ENDPOINT}/" /etc/openvpn/client.conf.tmpl > /etc/openvpn/client.conf
|
|
|
|
while true; do
|
|
if [ `jq ".uuid | length" $CONFIG_PATH` -eq 0 ]; then
|
|
echo "UUID missing from config file, VPN cannot connect"
|
|
sleep 2
|
|
else
|
|
read uuid api_key <<<$(jq -r '.uuid,.deviceApiKey // .apiKey' $CONFIG_PATH)
|
|
mkdir -p /var/volatile/
|
|
echo $uuid > /var/volatile/vpnfile
|
|
echo $api_key >> /var/volatile/vpnfile
|
|
break
|
|
fi
|
|
done
|