Compare commits

..

No commits in common. "main" and "0.23.0" have entirely different histories.
main ... 0.23.0

271 changed files with 1921 additions and 2577 deletions

View File

@ -5,138 +5,6 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.2.0] - 2025-08-26
### Removed
- Removed init bash files
## [1.1.3] - 2025-08-08
### Fixed
- Fix parsing of the output of '/bin/ip -json'
## [1.1.2] - 2025-07-31
### Changed
- Try several encodings on hivexregedit output
## [1.1.1] - 2025-07-29
### Fixed
- Correctly decode hivexregedit UTF-16LE output
## [1.1.0] - 2025-07-24
### Changed
- Have CrearImagenGit not receive the "tag" parameter
## [1.0.3] - 2025-07-24
### Fixed
- Have GetGitData deal with the fact that .git may be a regular file
## [1.0.2] - 2025-07-24
### Changed
- Write listSoftwareInfo errors in the log
## [1.0.1] - 2025-07-23
### Fixed
- Fixed small bugs in the py init scripts
## [1.0.0] - 2025-07-18
### Changed
- Renamed scripts so they don't have .py extension
## [0.30.1] - 2025-07-17
### Changed
- Have wrappers fail if functions return None
## [0.30.0] - 2025-07-17
### Added
- Add script for getting data out of deployed git images
## [0.29.0] - 2025-07-17
### Changed
- Now Configurar.py takes a third parameter: whether just check stuff or not
## [0.28.0] - 2025-07-17
### Changed
- Use python init scripts by default
## [0.27.0] - 2025-07-16
### Added
- Add python init scripts
## [0.26.1] - 2025-07-14
### Changed
- Change sort order in `_getAllDisks()`
## [0.26.0] - 2025-07-14
### Fixed
- Overhaul partitioning
## [0.25.2] - 2025-07-14
### Fixed
- Run initCache.py rather than just initCache
## [0.25.1] - 2025-07-11
### Changed
- Derive a strong password from the default opengnsys weak one
## [0.25.0] - 2025-07-11
## Added
- Add ogGit functionality
## [0.24.0] - 2025-07-11
### Added
- Configure and run filebeat
## [0.23.2] - 2025-07-07
### Changed
- Improved error reporting in ogCreateCache
## [0.23.1] - 2025-07-04
### Fixed
- Don't fail if grub.cfg is not found
## [0.23.0] - 2025-07-03
### Removed

View File

@ -1,49 +0,0 @@
#!/usr/bin/python3
# Proceso general de arranque de OpenGnsys Client.
import os
import re
import subprocess
import ogGlobals
from NetLib import ogGetIpAddress
ogstatus = os.environ.get ('ogstatus', '')
ogcore = os.environ.get ('ogcore', '')
oglog = os.environ.get ('oglog', '')
oggroup = os.environ.get ('OGGROUP', '')
ogactiveadmin = os.environ.get ('ogactiveadmin', '')
LANG = os.environ.get ('LANG', 'es_ES')
LANG = LANG[0:LANG.index('_')]
LOGLEVEL=5
# Matando plymount para inicir browser o shell
subprocess.run (['pkill', '-9', 'plymouthd'])
# Arranque de OpenGnsys Client daemon (socket).
print (ogGlobals.lang.MSG_LAUNCHCLIENT)
# Indicar fichero de teclado de Qt para el idioma especificado (tipo "es.qmap").
if os.path.exists (f'/usr/local/etc/{LANG}.qmap'):
os.environ['QWS_KEYBOARD'] = f'TTY:keymap=/usr/local/etc/{LANG}.qmap'
if os.path.exists ('/usr/share/OGAgent/opengnsys/linux/OGAgentService.py') and ogstatus != 'offline':
os.chdir ('/usr/share/OGAgent')
os.environ['OGAGENTCFG_OGCORE_IP'] = ogcore
os.environ['OGAGENTCFG_OGLOG_IP'] = oglog
os.environ['OGAGENTCFG_URLMENU_SCHEME'] = 'http'
os.environ['OGAGENTCFG_URLMENU_IP'] = '127.0.0.1'
os.environ['OGAGENTCFG_URLMENU_PORT'] = '81'
subprocess.run (['python3', '-m', 'opengnsys.linux.OGAgentService', 'fg'])
else:
ip = ogGetIpAddress()
OGMENU = ''
for FILE in [index, oggroup, ip]:
if not FILE: continue
m = f'{ogGlobals.OGCAC}/menus/{FILE}.html'
if os.path.exists (m): OGMENU = m
subprocess.run ([f'{ogGlobals.OPENGNSYS}/bin/launch_browser', m])
# Si fallo en cliente y modo "admin", cargar shell; si no, salir.
if ogactiveadmin == 'true':
subprocess.run (['bash'])

View File

@ -0,0 +1,46 @@
#!/bin/bash
# Proceso general de arranque de OpenGnsys Client.
# Fichero de registro de incidencias (en el servidor; si no, en local).
OPENGNSYS=${OPENGNSYS:-/opt/opengnsys}
OGLOGFILE=${OGLOGFILE:-$OPENGNSYS/log/$(ogGetIpAdderss).log}
if ! touch $OGLOGFILE 2>/dev/null; then
OGLOGFILE=/var/log/opengnsys.log
fi
LOGLEVEL=5
# Matando plymount para inicir browser o shell
pkill -9 plymouthd
# Arranque de OpenGnsys Client daemon (socket).
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 [ -f "/usr/share/OGAgent/opengnsys/linux/OGAgentService.py" -a "$ogstatus" != "offline" ]; then
# Ejecutar servicio cliente.
cd /usr/share/OGAgent
export OGAGENTCFG_OGCORE_IP=$ogcore
export OGAGENTCFG_OGLOG_IP=$oglog
export OGAGENTCFG_URLMENU_SCHEME=http
export OGAGENTCFG_URLMENU_IP=127.0.0.1
export OGAGENTCFG_URLMENU_PORT=81
(
## remove bash functions and some OG vars from the agent's environment
unset -f $(declare -F |awk '/og[A-Z]|NT[A-Z]/ { print $3 }')
unset $(declare |awk -F= '/^MSG_|^OG_ERR_/ { print $1 }')
python3 -m opengnsys.linux.OGAgentService fg
)
else
for FILE in index $OGGROUP $(ogGetIpAddress)
do
[ -f $OGCAC/menus/$FILE.html ] && OGMENU="$OGCAC/menus/$FILE.html"
done
$OPENGNSYS/bin/launch_browser $OGMENU
fi
# Si fallo en cliente y modo "admin", cargar shell; si no, salir.
if [ "$ogactiveadmin" == "true" ]; then
bash
fi

View File

@ -1,44 +0,0 @@
#!/usr/bin/python3
## early init
import os
import sys
OPENGNSYS = os.environ.get ('OPENGNSYS', '/opt/opengnsys')
libs = [f'{OPENGNSYS}/lib/python3', '/usr/share/opengnsys-modules/python3/dist-packages']
os.environ['PYTHONPATH'] = ':'.join (libs)
for l in libs: sys.path.insert (0, l)
## end
import subprocess
import ogGlobals
from InitLib import loadenviron, write_profile, clean_esp, fileslinks, loadmodules, metadevs, mountrepo, poweroff, filebeat, stunnel, dbus, otherservices, runhttplog
IPV4ADDR = os.environ.get ('IPV4ADDR', '')
OG_IP = os.environ.get ('OG_IP', '')
loadenviron()
write_profile()
# Funciones de inicio.
clean_esp()
fileslinks()
loadmodules()
metadevs()
mountrepo()
poweroff()
filebeat()
stunnel()
dbus()
otherservices()
runhttplog()
if IPV4ADDR and os.path.exists (f'{ogGlobals.OGETC}/init/{IPV4ADDR}.sh'):
if OG_IP: subprocess.run ([f'{ogGlobals.OGETC}/init/{OG_IP}.sh'])
elif os.path.exists (f'{ogGlobals.OGETC}/init.py'):
subprocess.run ([f'{ogGlobals.OGETC}/init.py'])
else:
print ('No se ha encontrado script de inicio')
subprocess.run (['halt'])

View File

@ -0,0 +1,12 @@
#!/bin/bash
F=/opt/opengnsys/functions
## BootLib.bootOs() makes a copy of grub.cfg in /boot/grub within the ESP
## clean it up
if $F/ogIsEfiActive; then
ESP=$($F/ogGetEsp)
MNTPT=$($F/ogMount $ESP)
rm -f $MNTPT/boot/grub/grub.cfg
$F/ogUnmount $ESP
fi

View File

@ -0,0 +1,25 @@
#!/bin/bash
# Cargar entorno de OpenGnsys
set -a
source /opt/opengnsys/etc/preinit/loadenviron.sh
# Scripts de inicio.
for f in cleanesp fileslinks loadmodules metadevs mountrepo poweroff otherservices; do
source $OGETC/preinit/$f.sh
done
unset f
if [ -f $OGETC/init/$IPV4ADDR.sh ]; then
$OGETC/init/$OG_IP.sh
elif [ -f $OGETC/init/$OGGROUP.sh ]; then
$OGETC/init/$OGGROUP.sh
elif [ -f $OGETC/init/default.sh ]; then
$OGETC/init/default.sh
else
echo "No se ha encontrado script de inicio"
halt
fi

View File

@ -0,0 +1,53 @@
#!/bin/bash
#/**
#@file fileslinks.sh
#@brief Script de inicio para copiar ficheros y deinir enlaces simbólicos.
#@warning License: GNU GPLv3+
#@version 0.9
#@author Ramon Gomez, ETSII Universidad de Sevilla
#@date 2009-10-10
#@version 1.0.5 - Enlace para librería libmac (obsoleto en versión 1.1.1).
#@author Ramon Gomez, ETSII Universidad de Sevilla
#@date 2012-06-28
#@version 1.1.2 - Autenticación con clave pública para SSH
#@author Irina Gómez, ETSII Universidad de Sevilla
#@date 2019-09-25
#*/
# Si está configurado OpenGnsys ...
if [ -n "$OPENGNSYS" ]; then
echo "${MSG_MAKELINKS:-.}"
# Shell BASH por defecto (para usar "runtest")
ln -fs /bin/bash /bin/sh 2>/dev/null
# Crear directorio de bloqueos
mkdir -p /var/lock 2>/dev/null || mkdir -p /run/lock
# Crear ficheros temporales.
touch $OGLOGCOMMAND $OGLOGCOMMAND.tmp $OGLOGSESSION /tmp/menu.tmp
chmod 777 $OGLOGCOMMAND $OGLOGCOMMAND.tmp $OGLOGSESSION /tmp/menu.tmp
# Enlaces para Qt Embeded.
QTDIR="/usr/local"
mkdir -p $QTDIR/{etc,lib,plugins}
for i in $OGLIB/qtlib/* $OGLIB/fonts; do
[ -f $QTDIR/lib/$i ] || ln -fs $i $QTDIR/lib 2>/dev/null
done
for i in $OGLIB/qtplugins/*; do
[ -f $QTDIR/plugins/$i ] || ln -fs $i $QTDIR/plugins 2>/dev/null
done
for i in $OGETC/*.qmap; do
[ -f $QTDIR/etc/$i ] || ln -fs $i $QTDIR/etc 2>/dev/null
done
# Autenticación con clave pública para SSH
[ -f /scripts/ssl/authorized_keys ] && cp /scripts/ssl/* /root/.ssh
else
# FIXME Error: entorno de OpenGnsys no configurado.
echo "Error: OpenGnsys environment is not configured." # FIXME: definir mensaje.
exit 1
fi

View File

@ -0,0 +1,150 @@
#!/bin/bash
#/**
#@file loadenviron.sh
#@brief Script de carga de la API de funciones de OpenGnsys.
#@warning License: GNU GPLv3+
#@version 0.9
#@author Ramon Gomez, ETSII Universidad de Sevilla
#@date 2009-10-10
#@version 1.0.3 - Limpiar código y configuración modo off-line
#@author Ramon Gomez, ETSII Universidad de Sevilla
#@date 2012-01-12
#@version 1.0.5 - Compatibilidad para usar proxy y servidor DNS.
#@author Ramon Gomez, ETSII Universidad de Sevilla
#@date 2014-04-23
#*/
# Idioma por defecto.
export LANG="${LANG:-es_ES}"
locale-gen $LANG
# Directorios del proyecto OpenGnsys.
export OPENGNSYS="${OPENGNSYS:-/opt/opengnsys}"
if [ -d $OPENGNSYS ]; then
export OGBIN=$OPENGNSYS/bin
export OGETC=$OPENGNSYS/etc
export OGLIB=$OPENGNSYS/lib
export OGAPI=$OGLIB/engine/bin
export OGPYFUNCS=$OPENGNSYS/functions
export OGSCRIPTS=$OPENGNSYS/scripts
export OGIMG=$OPENGNSYS/images
export OGCAC=$OPENGNSYS/cache
export OGLOG=$OPENGNSYS/log
export PATH=$OGSCRIPTS:$OGPYFUNCS:$OGBIN:$PATH:/opt/oglive/rootfs/opt/drbl/sbin
export PYTHONPATH=$OPENGNSYS/lib/python3
# Exportar parámetros del kernel.
for i in $(cat /proc/cmdline); do
echo $i | grep -q "=" && export $i
done
# Cargar sysctls
sysctl -p &>/dev/null
# Cargar fichero de idioma.
LANGFILE=$OGETC/lang.${LANG%@*}.conf
if [ -f $LANGFILE ]; then
source $LANGFILE
for i in $(awk -F= '{if (NF==2) print $1}' $LANGFILE); do
export $i
done
fi
# Mensaje de carga del entorno.
echo "${MSG_LOADAPI:-.}"
# Cargar mapa de teclado.
loadkeys ${LANG%_*} >/dev/null
# Cargar API de funciones.
for i in $OGAPI/*.lib; do
source $i
done
for i in $(typeset -F | cut -f3 -d" "); do
export -f $i
done
# Cargar configuración del engine.
[ -f ${OGETC}/engine.cfg ] && source ${OGETC}/engine.cfg
export OGLOGCOMMAND=${OGLOGCOMMAND:-/tmp/command.log}
export OGLOGSESSION=${OGLOGSESSION:-/tmp/session.log}
# Cargar las APIs según engine.
if [ -n "$ogengine" ]; then
for i in $OGAPI/*.$ogengine; do
[ -f $i ] && source $i
done
fi
# Configuración de la red (modo offline).
eval $(grep "^DEVICECFG=" /tmp/initrd.cfg 2>/dev/null)
if [ -n "$DEVICECFG" ]; then
export DEVICECFG
[ -f $DEVICECFG ] && source $DEVICECFG
fi
# FIXME Pruebas para grupos de ordenadores
export OGGROUP="$group"
ROOTREPO=${ROOTREPO:-"$OGSERVERIMAGES"}
# Fichero de registros.
export OGLOGFILE="$OGLOG/$(ogGetIpAddress).log"
fi
# Compatibilidad para usar proxy en clientes ogLive.
[ -z "$http_proxy" -a -n "$ogproxy" ] && export http_proxy="$ogproxy"
# Compatibilidad para usar servidor DNS en clientes ogLive.
if [ ! -f /run/resolvconf/resolv.conf -a -n "$ogdns" ]; then
mkdir -p /run/resolvconf
echo "nameserver $ogdns" > /run/resolvconf/resolv.conf
fi
# Declaración de códigos de error.
export OG_ERR_FORMAT=1 # Formato de ejecución incorrecto.
export OG_ERR_NOTFOUND=2 # Fichero o dispositivo no encontrado.
export OG_ERR_PARTITION=3 # Error en partición de disco.
export OG_ERR_LOCKED=4 # Partición o fichero bloqueado.
export OG_ERR_IMAGE=5 # Error al crear o restaurar una imagen.
export OG_ERR_NOTOS=6 # Sin sistema operativo.
export OG_ERR_NOTEXEC=7 # Programa o función no ejecutable.
# Códigos 8-13 reservados por ogAdmClient.h
export OG_ERR_NOTWRITE=14 # No hay acceso de escritura
export OG_ERR_NOTCACHE=15 # No hay particion cache en cliente
export OG_ERR_CACHESIZE=16 # No hay espacio en la cache para almacenar fichero-imagen
export OG_ERR_REDUCEFS=17 # Error al reducir sistema archivos
export OG_ERR_EXTENDFS=18 # Error al expandir el sistema de archivos
export OG_ERR_OUTOFLIMIT=19 # Valor fuera de rango o no válido.
export OG_ERR_FILESYS=20 # Sistema de archivos desconocido o no se puede montar
export OG_ERR_CACHE=21 # Error en partición de caché local
export OG_ERR_NOGPT=22 # El disco indicado no contiene una particion GPT
export OG_ERR_REPO=23 # Error al montar el repositorio de imagenes
export OG_ERR_NOMSDOS=24 # El disco indicado no contienen una particion MSDOS
export OG_ERR_IMGSIZEPARTITION=30 # Error al restaurar partición más pequeña que la imagen
export OG_ERR_UPDATECACHE=31 # Error al realizar el comando updateCache
export OG_ERR_DONTFORMAT=32 # Error al formatear
export OG_ERR_IMAGEFILE=33 # Archivo de imagen corrupto o de otra versión de $IMGPROG
export OG_ERR_GENERIC=40 # Error imprevisto no definido
export OG_ERR_UCASTSYNTAXT=50 # Error en la generación de sintaxis de transferenica UNICAST
export OG_ERR_UCASTSENDPARTITION=51 # Error en envío UNICAST de partición
export OG_ERR_UCASTSENDFILE=52 # Error en envío UNICAST de un fichero
export OG_ERR_UCASTRECEIVERPARTITION=53 # Error en la recepcion UNICAST de una particion
export OG_ERR_UCASTRECEIVERFILE=54 # Error en la recepcion UNICAST de un fichero
export OG_ERR_MCASTSYNTAXT=55 # Error en la generacion de sintaxis de transferenica Multicast.
export OG_ERR_MCASTSENDFILE=56 # Error en envio MULTICAST de un fichero
export OG_ERR_MCASTRECEIVERFILE=57 # Error en la recepcion MULTICAST de un fichero
export OG_ERR_MCASTSENDPARTITION=58 # Error en envio MULTICAST de una particion
export OG_ERR_MCASTRECEIVERPARTITION=59 # Error en la recepcion MULTICAST de una particion
export OG_ERR_PROTOCOLJOINMASTER=60 # Error en la conexion de una sesion UNICAST|MULTICAST con el MASTER
export OG_ERR_DONTMOUNT_IMAGE=70 # Error al montar una imagen sincronizada.
export OG_ERR_DONTSYNC_IMAGE=71 # Imagen no sincronizable (es monolitica)
export OG_ERR_DONTUNMOUNT_IMAGE=72 # Error al desmontar la imagen
export OG_ERR_NOTDIFFERENT=73 # No se detectan diferencias entre la imagen basica y la particion.
export OG_ERR_SYNCHRONIZING=74 # Error al sincronizar, puede afectar la creacion/restauracion de la imagen
export OG_ERR_NOTUEFI=80 # La interfaz UEFI no está activa
export OG_ERR_NOTBIOS=81 # La interfaz BIOS legacy no está activa

View File

@ -0,0 +1,23 @@
#!/bin/bash
#/**
#@file loadmodules.sh
#@brief Script de inicio para cargar módulos complementarios del kernel.
#@version 1.0
#@author Ramon Gomez, ETSII Universidad de Sevilla
#@date 2010-01-26
#@version 1.0.5 - Cargar módulos específicos para el cliente.
#@author Ramon Gomez, ETSII Universidad de Sevilla
#@date 2013-11-11
#*/
echo "${MSG_LOADMODULES:-.}"
# Módulo del ratón.
modprobe psmouse 2>/dev/null
# Cargar módulos específicos del kernel del cliente.
for m in $OGLIB/modules/$(uname -r)/*.ko; do
[ -r $m ] && insmod $m &>/dev/null
done

View File

@ -0,0 +1,28 @@
#!/bin/bash
#/**
#@file metadevs.sh
#@brief Script de inicio para detectar metadispositivos LVM y RAID.
#@note Desglose del script "loadenviron.sh".
#@warning License: GNU GPLv3+
#@version 0.9
#@author Ramon Gomez, ETSII Universidad de Sevilla
#@date 2009-10-10
#@version 0.9.4
#@author Ramon Gomez, ETSII Universidad de Sevilla
#@date 2010-04-19
#*/
# Si está configurado OpenGnsys ...
if [ -n "$OPENGNSYS" ]; then
echo "$MSG_DETECTLVMRAID"
# Detectar metadispositivos LVM.
vgchange -ay &>/dev/null
# Detectar metadispositivos RAID.
dmraid -ay &>/dev/null
else
# FIXME Error: entorno de OpenGnsys no configurado.
echo "Error: OpenGnsys environment is not configured." # FIXME: definir mensaje.
exit 1
fi

View File

@ -0,0 +1,54 @@
#!/bin/bash
#/**
#@file mountrepo.sh
#@brief Script para montar el repositorio de datos remoto.
#@warning License: GNU GPLv3+
#@version 1.0
#@author Ramon Gomez, ETSII Universidad de Sevilla
#@date 2011-03-17
#*/
OGIMG=${OGIMG:-/opt/opengnsys/images}
ROOTREPO=${ROOTREPO:-"$ROOTSERVER"}
# TODO Revisar proceso de arranque para no montar 2 veces el repositorio.
if [ "$ogactiveadmin" == "true" ]; then
export boot=admin # ATENCIÓN: siempre en modo "admin".
umount $OGIMG 2>/dev/null
protocol=${ogprotocol:-"smb"}
[ "$ogunit" != "" ] && OGUNIT="/$ogunit"
printf "$MSG_MOUNTREPO\n" "$protocol" "$boot"
case "$ogprotocol" in
nfs) mount.nfs ${ROOTREPO}:$OGIMG$OGUNIT $OGIMG -o rw,nolock ;;
smb) PASS=$(grep "^[ ]*\(export \)\?OPTIONS=" /scripts/ogfunctions 2>&1 | \
sed 's/\(.*\)pass=\(\w*\)\(.*\)/\2/')
PASS=${PASS:-"og"}
mount.cifs //${ROOTREPO}/ogimages$OGUNIT $OGIMG -o rw,serverino,acl,username=opengnsys,password=$PASS
;;
local) # TODO: hacer funcion dentro de este script que monte smb
# Comprobamos que estatus sea online.
if [ "$ogstatus" == "offline" -o "$SERVER" == "" ]; then
# Si estatus es offline buscamos un dispositivo con etiqueta repo
# y si no existe montamos la cache como repo (si existe).
TYPE=$(blkid | grep REPO | awk -F"TYPE=" '{print $2}' | tr -d \")
if [ "$TYPE" == "" ]; then
[ -d $OGCAC/$OGIMG ] && mount --bind $OGCAC/$OGIMG $OGIMG
else
mount -t $TYPE LABEL=REPO $OGIMG &>/dev/null
fi
else
# Comprobamos que existe un servicio de samba.
smbclient -L $SERVER -N &>/dev/null
if [ $? -eq 0 ]; then
PASS=$(grep "^[ ]*\(export \)\?OPTIONS=" /scripts/ogfunctions 2>&1 | \
sed 's/\(.*\)pass=\(\w*\)\(.*\)/\2/')
PASS=${PASS:-"og"}
mount.cifs //${ROOTREPO}/ogimages $OGIMG -o rw,serverino,acl,username=opengnsys,password=$PASS
fi
# TODO: buscar condicion para NFS
fi
;;
esac
fi

View File

@ -0,0 +1,77 @@
#!/bin/bash
#/**
#@file otherservices.sh
#@brief Script de inicio para cargar otros servicios complementarios.
#@version 1.0.3
#@author Ramon Gomez, ETSII Universidad de Sevilla
#@date 2012-01-12
#*/
ogIsEfiActive && mount -t efivarfs none /sys/firmware/efi/efivars
echo "${MSG_OTHERSERVICES:-.}"
# stunnel start
cat >/etc/stunnel/menu.conf <<__EOF__
setuid = stunnel4
setgid = stunnel4
pid = /var/run/stunnel4/menu.pid
foreground = yes
debug = info
[menu]
client = yes
accept = 127.0.0.1:81
connect = $ogcore:8443
__EOF__
if [[ true == "$ogusetls" ]]; then
if [[ true == "$ogverifytls" ]]; then
## use tls and verify
cat >>/etc/stunnel/menu.conf <<__EOF__
cert = /opt/opengnsys/etc/ogagent.crt
key = /opt/opengnsys/etc/ogagent.key
CAfile = /opt/opengnsys/etc/ca.crt
requireCert = yes
verifyChain = yes
__EOF__
else
## use tls but not verify
cat >>/etc/stunnel/menu.conf <<__EOF__
cert = /opt/opengnsys/etc/ogagent.crt
key = /opt/opengnsys/etc/ogagent.key
CAfile = /opt/opengnsys/etc/ca.crt
requireCert = no
verifyChain = no
__EOF__
fi
else
## don't use tls
cat >>/etc/stunnel/menu.conf <<__EOF__
requireCert = no
verifyChain = no
__EOF__
fi
mkdir -p /var/run/stunnel4; chown stunnel4:stunnel4 /var/run/stunnel4
stunnel /etc/stunnel/menu.conf &>/var/log/stunnel4/menu.log &
# stunnel end
# dbus
if [ -e /etc/dbus-1/system.d/ogbrowser.conf ]; then
mkdir -p /run/dbus
DBUS_SESSION_BUS_ADDRESS=$(dbus-daemon --print-address --system --nosyslog)
export DBUS_SESSION_BUS_ADDRESS
dbus-monitor --system &>/var/log/dbus-monitor.log &
fi
[ -S /dev/log ] || service rsyslog start
# root password
PASS=$(grep "^[ ]*\(export \)\?OPTIONS=" /scripts/ogfunctions 2>&1 | sed 's/\(.*\)pass=\(\w*\)\(.*\)/\2/')
PASS=${PASS:-"og"}
echo -ne "$PASS\n$PASS\n" | passwd root 2>/dev/null
cp -a $OPENGNSYS/etc/preinit/loadenviron.sh /etc/profile.d/
/etc/init.d/ssh start &>/dev/null
#setterm -blank 0 -powersave off -powerdown 0 < /dev/console > /dev/console 2>&1 ## apagado de monitor
ethtool -s $DEVICE wol g 2>/dev/null ## Activado WOL en la interfaz usada en arranque PXE.
[ -f /opt/opengnsys/scripts/runhttplog.sh ] && /opt/opengnsys/scripts/runhttplog.sh 2>/dev/null

View File

@ -0,0 +1,40 @@
#!/bin/bash
#/**
#@file poweroff.sh
#@brief Script de inicio para cargar el proceso comprobación de clientes inactivos.
#@note Arranca y configura el proceso "cron".
#@warning License: GNU GPLv3+
#@version 1.0.2
#@author Ramon Gomez, ETSII Universidad de Sevilla
#@date 2011-10-25
#*/
# Si está configurado OpenGnsys ...
if [ -n "$OPENGNSYS" ]; then
echo "${MSG_POWEROFFCONF:-.}"
# Sincronización horaria con servidor NTP.
[ -n "$ogntp" -a "$status" != "offline" ] && ntpdate $ogntp
# Crear fichero de configuración por defecto (30 min. de espera).
POWEROFFCONF=/etc/poweroff.conf
cat << FIN > $POWEROFFCONF
POWEROFFSLEEP=30
POWEROFFTIME=
FIN
# Incluir zona horaria en el fichero de configuración.
awk 'BEGIN {RS=" "} /^TZ=/ {print}' /proc/cmdline >> $POWEROFFCONF
# Lanzar el proceso "cron".
cron -l
# Definir la "crontab" lanzando el proceso de comprobación cada minuto.
echo "* * * * * [ -x $OGBIN/poweroffconf ] && $OGBIN/poweroffconf" | crontab -
else
# FIXME Error: entorno de OpenGnsys no configurado.
echo "Error: OpenGnsys environment is not configured." # FIXME: definir mensaje.
exit 1
fi

View File

@ -19,7 +19,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogAddCmd (args.disk, args.par, args.cmdfile, args.cmd)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -18,7 +18,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogAddRegistryKey (args.mntpt, args.hive, args.k)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -19,7 +19,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogAddRegistryValue (args.mntpt, args.hive, args.k, args.vtype)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -39,7 +39,6 @@ elif 4 == len (sys.argv):
elif 5 == len (sys.argv):
ret = ogBoot (args.disk, args.par, not not args.nvramperm, args.params)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -20,7 +20,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogBootLoaderDefaultEntry (args.disk, args.par, args.diskdefault, args.pardefault)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -20,7 +20,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogBootLoaderDeleteEntry (args.disk, args.par, args.diskdel, args.pardel)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -27,7 +27,6 @@ if 3 == len (sys.argv):
elif 5 == len (sys.argv):
ret = ogBootLoaderHidePartitions (args.disk, args.par, args.datadisk, args.datapar)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -18,7 +18,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogBootLoaderOgliveDefaultEntry (args.disk, args.par)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -19,7 +19,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogBootLoaderSetTimeOut (args.disk, args.par, args.timeout)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -16,7 +16,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogBootMbrGeneric (args.disk)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -16,7 +16,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogBootMbrXP (args.disk)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -26,7 +26,6 @@ if 3 == len (sys.argv):
elif 4 == len (sys.argv):
ret = ogCalculateChecksum (container=f'{args.disk} {args.par}', file=args.file)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -26,7 +26,6 @@ if 3 == len (sys.argv):
elif 4 == len (sys.argv):
ret = ogCalculateFullChecksum (container=f'{args.disk} {args.par}', file=args.file)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -16,7 +16,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogChangeRepo (args.ip_repo)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -17,7 +17,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogCheckFs (args.disk, args.par)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -16,7 +16,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogCheckIpAddress (args.ip)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -17,7 +17,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogCleanLinuxDevices (args.disk, args.par)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -17,7 +17,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogCleanOs (args.disk, args.par)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -17,7 +17,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogConfigureFstab (args.disk, args.par)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -17,7 +17,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogConfigureOgagent (args.disk, args.par)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -17,7 +17,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogCopyEfiBootLoader (args.disk, args.par)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -86,7 +86,6 @@ else:
sys.exit (1)
ret = ogCopyFile (src, dst)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -30,7 +30,6 @@ elif 3 == len (sys.argv):
elif 4 == len (sys.argv):
ret = ogCreateCache (ndsk=int(args.disk), part=int(args.part), sizecache=int(args.sizecache))
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -0,0 +1,23 @@
#!/usr/bin/python3
import sys
import argparse
from SystemLib import ogHelp
from DiskLib import ogCreateGptPartitions
if 2 == len (sys.argv) and 'help' == sys.argv[1]:
#parser.print_help() sale en inglés aunque la locale indique otra cosa
ogHelp ('ogCreateGptPartitions', 'ogCreateGptPartitions int_ndisk str_parttype:int_partsize ...', ['ogCreateGptPartitions 1 NTFS:10000000 EXT3:5000000 LINUX-SWAP:1000000'])
sys.exit (0)
parser = argparse.ArgumentParser (add_help=False)
parser.add_argument ('disk')
parser.add_argument ('parts', nargs='+')
args = parser.parse_args()
ret = ogCreateGptPartitions (args.disk, args.parts)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)
else: print (ret)

View File

@ -31,7 +31,6 @@ if 5 == len (sys.argv):
elif 7 == len (sys.argv):
ret = ogCreateImage (args.disk, args.par, args.container, args.imgfile, args.tool, args.level)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -19,7 +19,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogCreateImageSyntax (args.dev, args.imgfile, args.tool, args.level)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -24,7 +24,6 @@ if 2 == len (sys.argv):
elif 3 == len (sys.argv):
ret = ogCreatePartitionTable (args.disk, args.createptt)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -17,7 +17,6 @@ args = parser.parse_args()
ret = ogCreatePartitions (args.disk, args.parts)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -25,8 +25,6 @@ if 4 == len (sys.argv):
ret = ogCreateTorrent (container=args.container, file=args.file, ip_bttrack=args.ip_bttrack)
elif 5 == len (sys.argv):
ret = ogCreateTorrent (disk=args.disk, par=args.par, file=args.file, ip_bttrack=args.ip_bttrack)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -7,7 +7,6 @@ from CacheLib import ogDeleteCache
ret = ogDeleteCache()
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -26,7 +26,6 @@ if 3 == len (sys.argv):
elif 4 == len (sys.argv):
ret = ogDeleteFile (container=f'{args.disk} {args.par}', file=args.file)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -16,7 +16,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogDeletePartitionTable (args.disk)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -18,7 +18,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogDeleteRegistryKey (args.mntpt, args.hive, args.k)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -18,7 +18,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogDeleteRegistryValue (args.mntpt, args.hive, args.k)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -26,7 +26,6 @@ if 3 == len (sys.argv):
elif 4 == len (sys.argv):
ret = ogDeleteTree (container=f'{args.disk} {args.par}', file=args.file)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -16,7 +16,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogDevToDisk (args.arg_dev)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -17,7 +17,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogDiskToDev (args.arg_disk, args.arg_part)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -18,7 +18,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogEcho (args.logtypes, args.loglevel, args.msg)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -48,7 +48,6 @@ for arg in sys.argv[1:]:
args = tuple (args)
ret = ogExecAndLog (logtypes, fun, *args, **kwargs)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -17,7 +17,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogExtendFs (args.disk, args.par)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -16,7 +16,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogFindCache ()
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -17,7 +17,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogFixBootSector (args.disk, args.par)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -22,7 +22,6 @@ else:
args = parser.parse_args()
ret = ogFormat (args.disk, args.par, args.fs, args.label)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -16,7 +16,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogFormatCache ()
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -19,7 +19,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogFormatFs (args.disk, args.par, args.type, args.label)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -16,7 +16,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetArch ()
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -16,7 +16,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetBootMbr (args.disk)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -16,7 +16,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetCacheSize ()
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -7,7 +7,6 @@ from CacheLib import ogGetCacheSpace
ret = ogGetCacheSpace()
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -16,7 +16,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetCaller ()
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -16,7 +16,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetDiskSize (args.disk)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -16,7 +16,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetDiskType (args.dev)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -16,7 +16,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetEsp ()
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -18,7 +18,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetFreeSize (args.disk, args.part, args.unit)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -18,7 +18,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetFsSize (args.disk, args.par, args.unit)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -17,7 +17,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetFsType (args.disk, args.part)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -17,7 +17,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetHivePath (args.mntpt, args.hive)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -16,7 +16,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetHostname ()
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -17,7 +17,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetImageCompressor (args.container, args.filename)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -16,7 +16,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetImageInfo (args.imgfile)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -17,7 +17,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetImageProgram (args.container, args.filename)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -17,7 +17,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetImageSize (args.repo, args.imgname)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -17,7 +17,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetImageType (args.repo, args.imgname)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -16,7 +16,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetIpAddress ()
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -24,7 +24,6 @@ if 2 == len (sys.argv):
elif 3 == len (sys.argv):
ret = ogGetLastSector (args.disk, args.par)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -16,7 +16,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetMacAddress ()
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -17,7 +17,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetMountPoint (args.disk, args.par)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -17,7 +17,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetOsType (args.disk, args.partition)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -17,7 +17,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetOsUuid (args.disk, args.par)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -17,7 +17,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetOsVersion (args.disk, args.part)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -26,7 +26,6 @@ if 3 == len (sys.argv):
elif 4 == len (sys.argv):
ret = ogGetParentPath (src=f'{args.disk} {args.par}', file=args.file)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -16,7 +16,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetPartitionActive (args.disk)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -17,7 +17,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetPartitionId (args.disk, args.par)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -17,7 +17,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetPartitionSize (args.disk, args.par)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -16,7 +16,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetPartitionTableType (args.disk)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -17,7 +17,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetPartitionType (args.disk, args.par)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -16,7 +16,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetPartitionsNumber (args.disk)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -30,7 +30,6 @@ elif 3 == len (sys.argv):
elif 4 == len (sys.argv):
ret = ogGetPath (src=f'{args.disk} {args.par}', file=args.file)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -18,7 +18,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetRegistryValue (args.mntpt, args.hive, args.k)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -16,7 +16,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetRepoIp ()
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -11,7 +11,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
ret = ogGetSerialNumber()
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -16,7 +16,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetServerIp ()
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -17,7 +17,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGetWindowsName (args.disk, args.par)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -17,7 +17,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGrub4dosInstallMbr (args.disk, args.par)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -19,7 +19,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGrubAddOgLive (args.disk, args.par, args.timeout, args.offline)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -19,7 +19,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGrubDefaultEntry (args.disk, args.par, args.diskdefault, args.pardefault)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

View File

@ -19,7 +19,6 @@ if 2 == len (sys.argv) and 'help' == sys.argv[1]:
args = parser.parse_args()
ret = ogGrubDeleteEntry (args.disk, args.par, args.diskdel, args.pardel)
if ret is None: sys.exit (1)
if ret is not None:
if ret == True: sys.exit (0)
elif ret == False: sys.exit (1)

Some files were not shown because too many files have changed in this diff Show More