summaryrefslogtreecommitdiffstats
path: root/server/bin/setserveraddr
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2020-03-20 14:28:07 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2020-06-02 12:32:36 +0200
commit51ce65ce86230d5a9320b83cd3be20da2dbb09ef (patch)
treec564c1cd080135271e3107058500603adcb2297a /server/bin/setserveraddr
parent0549150265a132055b3c700d36137da20908e2b4 (diff)
#980 Add ogClient to the installer and update the setserveraddr script
This also removes the legacy ogAdmClient for these scripts.
Diffstat (limited to 'server/bin/setserveraddr')
-rwxr-xr-xserver/bin/setserveraddr8
1 files changed, 6 insertions, 2 deletions
diff --git a/server/bin/setserveraddr b/server/bin/setserveraddr
index 18ee8c6a..c3898724 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,ogAdmAgent}.cfg,www/controlacceso.php,client/etc/ogAdmClient.cfg}; do
+for f in $OPENGNSYS/{etc/{ogAdmServer,ogAdmRepo,ogAdmAgent}.cfg,www/controlacceso.php,client/ogClient/cfg/ogclient.cfg}; do
[ -w $f ] || raiseError access "Cannot write to file: $f"
done
@@ -88,7 +88,7 @@ if [ -n "$SERVERIP" ]; then
OLDSERVERIP=$ServidorAdm
# Checking if configuration files need to be modified.
CHANGE=0
- for f in $OPENGNSYS/{etc/{ogAdmServer,ogAdmRepo,ogAdmAgent}.cfg,www/controlacceso.php,client/etc/ogAdmClient.cfg}; do
+ for f in $OPENGNSYS/{etc/{ogAdmServer,ogAdmRepo,ogAdmAgent}.cfg,www/controlacceso.php}; do
# Updating configuration variables (if URL does not contain "localhost").
sed -e "s,\(ServidorAdm\|IPlocal\)=.*,\1=$SERVERIP," \
-e "s,^INTERFACE=.*,INTERFACE=$SERVERDEV," \
@@ -105,6 +105,10 @@ 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
# Restart OpenGnsys services.
echo "Restarting services..."
restart opengnsys >/dev/null