mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-28 11:24:04 +02:00
Update 99-run.sh
This commit is contained in:
@@ -11,6 +11,39 @@ for k in $(bashio::jq "/data/options.json" 'keys | .[]'); do
|
|||||||
done
|
done
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
###################
|
||||||
|
# Custom provider #
|
||||||
|
###################
|
||||||
|
|
||||||
|
if bashio::config.true "OPENVPN_CUSTOM_PROVIDER"; then
|
||||||
|
|
||||||
|
OVPNLOCATION="$(bashio::config "OPENVPN_CUSTOM_PROVIDER_OVPN_LOCATION")"
|
||||||
|
OPENVPN_PROVIDER="${OVPNLOCATION##*/}"
|
||||||
|
OPENVPN_PROVIDER="${OPENVPN_PROVIDER%.*}"
|
||||||
|
bashio::log.info "Custom openvpn provider selected"
|
||||||
|
|
||||||
|
# Check that ovpn file exists
|
||||||
|
if [ ! -f bashio::config "OPENVPN_CUSTOM_PROVIDER_OVPN_LOCATION" ]; then
|
||||||
|
bashio::log.fatal "Ovpn file not found at location provided : $OVPNLOCATION"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Copy ovpn file
|
||||||
|
echo "Copying ovpn file to proper location"
|
||||||
|
mkdir /openvpn/"$OPENVPN_PROVIDER"
|
||||||
|
cp "$OVPNLOCATION" /openvpn/"$OPENVPN_PROVIDER"/
|
||||||
|
|
||||||
|
# Use custom provider
|
||||||
|
echo "Exporting variable for custom provider : $OPENVPN_PROVIDER"
|
||||||
|
export OPENVPN_PROVIDER="$OPENVPN_PROVIDER"
|
||||||
|
export OPENVPN_CONFIG="$OPENVPN_PROVIDER"
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
bashio::log.info "Custom openvpn provider not selected, the provider $OPENVPN_PROVIDER will be used"
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
#######################
|
#######################
|
||||||
# Run haugene scripts #
|
# Run haugene scripts #
|
||||||
#######################
|
#######################
|
||||||
|
|||||||
Reference in New Issue
Block a user