refs #1134 #1142 changes all permissions of clients, updates default.sh

ogboot-log
Luis Gerardo Romero Garcia 2024-11-14 09:52:10 +01:00
parent b825088da8
commit 570668f9ab
2 changed files with 10 additions and 7 deletions

View File

@ -18,20 +18,20 @@ echo "${MSG_LAUNCHCLIENT:-.}"
# Indicar fichero de teclado de Qt para el idioma especificado (tipo "es.qmap").
[ -f /usr/local/etc/${LANG%_*}.qmap ] && export QWS_KEYBOARD="TTY:keymap=/usr/local/etc/${LANG%_*}.qmap"
if [ -x "$OPENGNSYS/bin/ogAdmClient" -a "$ogstatus" != "offline" ]; then
if [ -f "/usr/share/OGAgent/opengnsys/linux/OGAgentService.py" -a "$ogstatus" != "offline" ]; then
# Ejecutar servicio cliente.
$OPENGNSYS/bin/ogAdmClient -f $OPENGNSYS/etc/ogAdmClient.cfg -l $OGLOGFILE -d $LOGLEVEL
cd /usr/share/OGAgent
sed -i -e "/remote=/ s/https:/http:/; /remote=/ s%192.168.[^/]*/%${ogcore}:8000/%" cfg/ogagent.cfg
python3 -m opengnsys.linux.OGAgentService fg
else
for FILE in index $OGGROUP $(ogGetIpAddress)
do
[ -f $OGCAC/menus/$FILE.html ] && OGMENU="$OGCAC/menus/$FILE.html"
[ -f $OGCAC/menus/$FILE.html ] && OGMENU="$OGCAC/menus/$FILE.html"
done
$OPENGNSYS/bin/browser -qws $OGMENU
/usr/bin/OGBrowser -qws $OGMENU
fi
# Si fallo en cliente y modo "admin", cargar shell; si no, salir.
if [ "$ogactiveadmin" == "true" ]; then
bash
fi

View File

@ -464,6 +464,8 @@ def copyClientFiles():
config_file.write(content)
logger.info("Configuration file ogAdmClient.cfg created successfully.")
# Change ownership of INSTALL_OGBOOT_TARGET/client/ and its contents
subprocess.run(f"chown -R opengnsys:opengnsys {INSTALL_OGBOOT_TARGET}/client/", shell=True, text=True, capture_output=True)
except Exception as e:
logger.error(f"Error creating ogAdmClient.cfg: {e}")
@ -476,6 +478,7 @@ def copyClientFiles():
return not errstatus
def get_first_network_interface_with_traffic():
with open('/proc/net/dev') as f:
for line in f: