summaryrefslogtreecommitdiffstats
path: root/installer/opengnsys_installer.sh
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2020-10-16 10:47:03 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2020-10-16 15:08:59 +0200
commit5cbc75b23cd7e5aae41308b63b16fe44d5eb2a69 (patch)
treebd5e1bfcf3eeb239585d4deefee56cded0058ede /installer/opengnsys_installer.sh
parent4b6cd04f1dbbfef8c4af42d76c4aad1c36547e22 (diff)
#988 Add ogServer JSON config to installer
This commit changes legacy ogServer configuration file to new ogServer JSON configuration file.
Diffstat (limited to 'installer/opengnsys_installer.sh')
-rwxr-xr-xinstaller/opengnsys_installer.sh24
1 files changed, 18 insertions, 6 deletions
diff --git a/installer/opengnsys_installer.sh b/installer/opengnsys_installer.sh
index 94f15de8..dd17837d 100755
--- a/installer/opengnsys_installer.sh
+++ b/installer/opengnsys_installer.sh
@@ -1502,11 +1502,23 @@ function openGnsysConfigure()
echoAndLog "${FUNCNAME}(): Creating OpenGnsys config files."
for dev in ${DEVICE[*]}; do
if [ -n "${SERVERIP[i]}" ]; then
- sed -e "s/SERVERIP/${SERVERIP[i]}/g" \
- -e "s/DBUSER/$OPENGNSYS_DB_USER/g" \
- -e "s/DBPASSWORD/$OPENGNSYS_DB_PASSWD/g" \
- -e "s/DATABASE/$OPENGNSYS_DATABASE/g" \
- "$WORKDIR"/ogServer-"$BRANCH"/cfg/ogserver.cfg > "$INSTALL_TARGET"/etc/ogserver-"$dev".cfg
+ echo "{
+ \"rest\" : {
+ \"ip\" : \"${SERVERIP[i]}\",
+ \"port\" : \"8888\",
+ \"api_token\": \"5a5ca1172136299640a9f47469237e0a\"
+ },
+ \"database\" : {
+ \"ip\": \"127.0.0.1\",
+ \"port\": \"3306\",
+ \"name\" : \"$OPENGNSYS_DATABASE\",
+ \"user\" : \"$OPENGNSYS_DB_USER\",
+ \"pass\" : \"$OPENGNSYS_DB_PASSWD\"
+ },
+ \"wol\" : {
+ \"interface\" : \"$dev\"
+ }
+ }" | jq '.' > "$INSTALL_TARGET"/etc/ogserver-"$dev".json
sed -e "s/SERVERIP/${SERVERIP[i]}/g" \
$WORKDIR/opengnsys/repoman/etc/ogAdmRepo.cfg.tmpl > $INSTALL_TARGET/etc/ogAdmRepo-$dev.cfg
CONSOLEURL="https://${SERVERIP[i]}/opengnsys"
@@ -1523,7 +1535,7 @@ function openGnsysConfigure()
fi
let i++
done
- ln -f $INSTALL_TARGET/etc/ogserver-$DEFAULTDEV.cfg $INSTALL_TARGET/etc/ogserver.cfg
+ ln -f $INSTALL_TARGET/etc/ogserver-$DEFAULTDEV.json $INSTALL_TARGET/etc/ogserver.json
ln -f $INSTALL_TARGET/etc/ogAdmRepo-$DEFAULTDEV.cfg $INSTALL_TARGET/etc/ogAdmRepo.cfg
ln -f $INSTALL_TARGET/www/controlacceso-$DEFAULTDEV.php $INSTALL_TARGET/www/controlacceso.php