diff options
author | Javier Sánchez Parra <jsanchez@soleta.eu> | 2020-05-15 10:37:37 +0200 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2020-05-19 18:29:47 +0200 |
commit | e3d5f9af37113f20afd327bd921683676f5315aa (patch) | |
tree | 48e1f0c175f1906af4e7ac3f2e3841b545bd7f2f | |
parent | d1fbedf6089979a3c305d258e3cc7894fc32682c (diff) |
#980 use json file format in ogClient
-rwxr-xr-x | installer/opengnsys_installer.sh | 3 | ||||
-rwxr-xr-x | server/bin/setserveraddr | 8 |
2 files changed, 5 insertions, 6 deletions
diff --git a/installer/opengnsys_installer.sh b/installer/opengnsys_installer.sh index 335ab531..ff286a51 100755 --- a/installer/opengnsys_installer.sh +++ b/installer/opengnsys_installer.sh @@ -1544,8 +1544,7 @@ EOT echoAndLog "${FUNCNAME}(): Creating ogClient config files." sed -i -e "s/127\.0\.0\.1/$OPENGNSYS_SERVERIP/g" \ - -e "s/1234/8889/g" \ - $INSTALL_TARGET/client/ogClient/cfg/ogclient.cfg + $INSTALL_TARGET/client/ogClient/cfg/ogclient.json } diff --git a/server/bin/setserveraddr b/server/bin/setserveraddr index c7920e6a..203e095b 100755 --- a/server/bin/setserveraddr +++ b/server/bin/setserveraddr @@ -33,7 +33,7 @@ source $OPENGNSYS/lib/ogfunctions.sh || exit 1 [ "$USER" != "root" ] && raiseError access "Need to be root" [ $# -ne 1 ] && raiseError usage [ -r $DEFAULTFILE ] || raiseError access "Cannot read default configuration file" -for f in $OPENGNSYS/{etc/{ogAdmServer,ogAdmRepo}.cfg,www/controlacceso.php,client/ogClient/cfg/ogclient.cfg}; do +for f in $OPENGNSYS/{etc/{ogAdmServer,ogAdmRepo}.cfg,www/controlacceso.php,client/ogClient/cfg/ogclient.json}; do [ -w $f ] || raiseError access "Cannot write to file: $f" done @@ -106,9 +106,9 @@ if [ -n "$SERVERIP" ]; then # Processing when something has changed. if [ $CHANGE == 1 ]; then # Config ogClient. - sed -i -e "s/^ip=.*/ip=$SERVERIP/g" \ - -e "s/^url=https:\/\/[0-9\.]*\//url=https:\/\/$SERVERIP\//g" \ - $OPENGNSYS/client/ogClient/cfg/ogclient.cfg + IP_PATTERN="[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}" + sed -i -e "s/$IP_PATTERN/$SERVERIP/g" \ + "$OPENGNSYS"/client/ogClient/cfg/ogclient.json # Restart OpenGnsys services. echo "Restarting services..." restart opengnsys >/dev/null |