Update generateConfig.sh
This commit is contained in:
parent
551516b6b8
commit
cc6612625d
1 changed files with 60 additions and 58 deletions
|
@ -2,10 +2,12 @@ CFG_PATH=$1
|
||||||
CFG_PATH_UPLOAD=$2
|
CFG_PATH_UPLOAD=$2
|
||||||
CONFIG_PATH=/data/options.json
|
CONFIG_PATH=/data/options.json
|
||||||
|
|
||||||
echo "Generating $CFG_PATH & $CFG_PATH_UPLOAD"
|
#CONFIG_CONNECTION_TYPE="$(jq --raw-output '.Connection_Type' $CONFIG_PATH)"
|
||||||
|
#CONFIG_BLUETOOTH="$(jq --raw-output '.Bluetooth' $CONFIG_PATH)"
|
||||||
|
#CONFIG_ETHERNET="$(jq --raw-output '.Ethernet' $CONFIG_PATH)"
|
||||||
CONFIG_BTADDRESS="$(jq --raw-output '.BTAddress' $CONFIG_PATH)"
|
CONFIG_BTADDRESS="$(jq --raw-output '.BTAddress' $CONFIG_PATH)"
|
||||||
CONFIG_LOCALBTADDRESS="$(jq --raw-output '.LocalBTAddress' $CONFIG_PATH)"
|
CONFIG_LOCALBTADDRESS="$(jq --raw-output '.LocalBTAddress' $CONFIG_PATH)"
|
||||||
|
CONFIG_IP_ADDRESS="$(jq --raw-output '.IP_Address' $CONFIG_PATH)"
|
||||||
CONFIG_PASSWORD="$(jq --raw-output '.Password' $CONFIG_PATH)"
|
CONFIG_PASSWORD="$(jq --raw-output '.Password' $CONFIG_PATH)"
|
||||||
CONFIG_MSI_ENABLED="$(jq --raw-output '.MIS_Enabled' $CONFIG_PATH)"
|
CONFIG_MSI_ENABLED="$(jq --raw-output '.MIS_Enabled' $CONFIG_PATH)"
|
||||||
CONFIG_PLANTNAME="$(jq --raw-output '.Plantname' $CONFIG_PATH)"
|
CONFIG_PLANTNAME="$(jq --raw-output '.Plantname' $CONFIG_PATH)"
|
||||||
|
@ -50,7 +52,7 @@ CONFIG_LOGLEVEL="$(jq --raw-output '.LogLevel' $CONFIG_PATH)"
|
||||||
CONFIG_PVOUTPUT_SID="$(jq --raw-output '.PVoutput_SID' $CONFIG_PATH)"
|
CONFIG_PVOUTPUT_SID="$(jq --raw-output '.PVoutput_SID' $CONFIG_PATH)"
|
||||||
CONFIG_PVOUTPUT_KEY="$(jq --raw-output '.PVoutput_Key' $CONFIG_PATH)"
|
CONFIG_PVOUTPUT_KEY="$(jq --raw-output '.PVoutput_Key' $CONFIG_PATH)"
|
||||||
|
|
||||||
cat > $CFG_PATH <<EOL
|
cat > "$CFG_PATH" <<EOL
|
||||||
################################################################################
|
################################################################################
|
||||||
# ____ ____ _____ _
|
# ____ ____ _____ _
|
||||||
# / ___|| __ )| ___|__ _ __ ___ | |_
|
# / ___|| __ )| ___|__ _ __ ___ | |_
|
||||||
|
@ -87,7 +89,7 @@ LocalBTAddress=$CONFIG_LOCALBTADDRESS
|
||||||
# If IP_Address is not set or is 0.0.0.0 SBFspot will try to detect the speedwire inverter by broadcast
|
# If IP_Address is not set or is 0.0.0.0 SBFspot will try to detect the speedwire inverter by broadcast
|
||||||
# If IP_Address is set to a valid IP, SBFspot will try to connect directly to that IP without broadcast detection
|
# If IP_Address is set to a valid IP, SBFspot will try to connect directly to that IP without broadcast detection
|
||||||
# Multiple IP addresses can be provided (comma separated)
|
# Multiple IP addresses can be provided (comma separated)
|
||||||
#IP_Address=0.0.0.0
|
IP_Address=$CONFIG_IP_ADDRESS
|
||||||
|
|
||||||
# User password (default 0000)
|
# User password (default 0000)
|
||||||
Password=$CONFIG_PASSWORD
|
Password=$CONFIG_PASSWORD
|
||||||
|
@ -246,7 +248,7 @@ EOL
|
||||||
|
|
||||||
#cat $1
|
#cat $1
|
||||||
|
|
||||||
cat > $CFG_PATH_UPLOAD <<EOL
|
cat > "$CFG_PATH_UPLOAD" <<EOL
|
||||||
################################################################################
|
################################################################################
|
||||||
# SBFspotUpload.cfg - Configuration file for SBFspotUploadService/Daemon
|
# SBFspotUpload.cfg - Configuration file for SBFspotUploadService/Daemon
|
||||||
# (c)2012-2014, SBF (https://sbfspot.codeplex.com)
|
# (c)2012-2014, SBF (https://sbfspot.codeplex.com)
|
||||||
|
@ -305,5 +307,5 @@ EOL
|
||||||
#cat $CFG_PATH_UPLOAD
|
#cat $CFG_PATH_UPLOAD
|
||||||
|
|
||||||
# create folders
|
# create folders
|
||||||
mkdir -p $CONFIG_OUTPUTPATH
|
mkdir -p "$CONFIG_OUTPUTPATH"
|
||||||
mkdir -p $CONFIG_LOGDIR
|
mkdir -p "$CONFIG_LOGDIR"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue