From 5cbc75b23cd7e5aae41308b63b16fe44d5eb2a69 Mon Sep 17 00:00:00 2001 From: Javier Sánchez Parra Date: Fri, 16 Oct 2020 10:47:03 +0200 Subject: #988 Add ogServer JSON config to installer This commit changes legacy ogServer configuration file to new ogServer JSON configuration file. --- installer/opengnsys_installer.sh | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'installer') 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 -- cgit v1.2.3-18-g5258