Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
|
50b52b92d4 | |
|
af00b6eedb |
591
CHANGELOG.md
591
CHANGELOG.md
|
@ -1,592 +1,7 @@
|
|||
# Changelog
|
||||
|
||||
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
|
||||
|
||||
- Remove several bash scripts under "scripts" and "interfaceAdm"
|
||||
|
||||
## [0.22.8] - 2025-07-03
|
||||
|
||||
### Removed
|
||||
|
||||
- Remove unused "cacheopts"
|
||||
|
||||
## [0.22.7] - 2025-07-03
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix dstat--show bandwith in the local cgi
|
||||
|
||||
## [0.22.6] - 2025-07-03
|
||||
|
||||
### Changed
|
||||
|
||||
- Include own IP address in the local CGI's title
|
||||
|
||||
## [0.22.5] - 2025-07-02
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed booting windows using winboot/kexec
|
||||
|
||||
## [0.22.4] - 2025-07-01
|
||||
|
||||
### Changed
|
||||
|
||||
- Do copy grub.cfg :) and clean it up on boot
|
||||
- Remove warning about /dev/loop0
|
||||
- Comment unused code out
|
||||
|
||||
## [0.22.3] - 2025-06-27
|
||||
|
||||
### Changed
|
||||
|
||||
- Don't copy grub.cfg
|
||||
|
||||
## [0.22.2] - 2025-06-27
|
||||
|
||||
### Fixed
|
||||
|
||||
- Don't check rc of updateBootCache.py because we may have no cache partition
|
||||
|
||||
## [0.22.1] - 2025-06-27
|
||||
|
||||
### Fixed
|
||||
|
||||
- Included some changes that should be in the previous version
|
||||
|
||||
## [0.22.0] - 2025-06-26
|
||||
|
||||
### Changed
|
||||
|
||||
- Changed torrent client from ctorrent to aria2c
|
||||
- Updated ogCreateTorrent function replaced ctorrent with mktorrent
|
||||
|
||||
## [0.21.1] - 2025-06-26
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed syntax and other errors
|
||||
|
||||
## [0.21.0] - 2025-06-25
|
||||
|
||||
### Changed
|
||||
|
||||
- Prevent Configurar.py from messing with the browser
|
||||
|
||||
## [0.20.3] - 2025-06-25
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed bugs when partitioning disks
|
||||
|
||||
## [0.20.2] - 2025-06-24
|
||||
|
||||
### Changed
|
||||
|
||||
- Do a couple of ogExecAndLog()s also when creating images
|
||||
|
||||
## [0.20.1] - 2025-06-24
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix mark for ogboot on linux
|
||||
|
||||
## [0.20.0] - 2025-06-24
|
||||
|
||||
### Changed
|
||||
|
||||
- In order to have /tmp/command.log updated in realtime, ogExecAndLog now spawns a subprocess rather than calling functions directly
|
||||
|
||||
## [0.19.2] - 2025-06-24
|
||||
|
||||
### Changed
|
||||
|
||||
- Write a mark for ogboot on linux only
|
||||
|
||||
## [0.19.1] - 2025-06-23
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed path of EFI boot entry
|
||||
|
||||
## [0.19.0] - 2025-06-23
|
||||
|
||||
### Changed
|
||||
|
||||
- Write a mark for ogboot
|
||||
|
||||
## [0.18.2] - 2025-06-19
|
||||
|
||||
### Fixed
|
||||
|
||||
- Accept None as partition type
|
||||
|
||||
## [0.18.1] - 2025-06-18
|
||||
|
||||
### Fixed
|
||||
|
||||
- Look for grub.cfg in two places rather than one
|
||||
|
||||
## [0.18.0] - 2025-06-16
|
||||
|
||||
### Added
|
||||
|
||||
- Added scripts and libs for oggit
|
||||
|
||||
## [0.17.0] - 2025-06-16
|
||||
|
||||
### Changed
|
||||
|
||||
- Removed useless warning about /dev/loop0
|
||||
- Fix windows EFI booting, and a typo
|
||||
|
||||
## [0.16.0] - 2025-06-12
|
||||
|
||||
### Changed
|
||||
|
||||
- Gave some care to the "Custom" scripts
|
||||
|
||||
## [0.15.3] - 2025-06-12
|
||||
|
||||
### Fixed
|
||||
|
||||
- Create missing dir
|
||||
|
||||
## [0.15.2] - 2025-06-11
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed a condition check
|
||||
|
||||
## [0.15.1] - 2025-06-11
|
||||
|
||||
### Fixed
|
||||
|
||||
- Add a missing "import"
|
||||
- Fix retrieving windows version from the registry
|
||||
- Fix bug while building the "Part-01-01" string
|
||||
- Removed obsolete unused "bootOS" scripts (with a capital "S")
|
||||
|
||||
## [0.15.0] - 2025-06-10
|
||||
|
||||
### Changed
|
||||
|
||||
- Remove opengnsys bash functions from the agent's environment
|
||||
|
||||
## [0.14.2] - 2025-06-09
|
||||
|
||||
### Fixed
|
||||
|
||||
- Get rc of bash pipelines in ProtocolLib
|
||||
|
||||
## [0.14.1] - 2025-06-07
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed rc management in deployImage.py
|
||||
|
||||
## [0.14.0] - 2025-06-07
|
||||
|
||||
### Changed
|
||||
|
||||
- Read $ogusetls and $ogverifytls from the environment and configure stunnel accordingly
|
||||
|
||||
## [0.13.9] - 2025-06-04
|
||||
|
||||
### Fixed
|
||||
|
||||
- Copy grub.cfg so that grub finds the config upon boot
|
||||
|
||||
## [0.13.8] - 2025-06-03
|
||||
|
||||
### Fixed
|
||||
|
||||
- Paid attention to return codes between python (True for success) and shell (0 for success)
|
||||
|
||||
## [0.13.7] - 2025-06-02
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed management of the "multicast session" parameter
|
||||
|
||||
## [0.13.6] - 2025-06-02
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed variable name in restoreImage.py
|
||||
|
||||
## [0.13.5] - 2025-05-30
|
||||
|
||||
### Fixed
|
||||
|
||||
- Return a true value from the unicast/multicast methods
|
||||
- Fully qualify a method call
|
||||
|
||||
## [0.13.4] - 2025-05-28
|
||||
|
||||
### Changed
|
||||
|
||||
- Show sgdisk output
|
||||
|
||||
## [0.13.3] - 2025-05-28
|
||||
|
||||
### Fixed
|
||||
|
||||
- unlink() only existing files
|
||||
|
||||
## [0.13.2] - 2025-05-28
|
||||
|
||||
### Changed
|
||||
|
||||
- Point urlMenu back to the localhost stunnel
|
||||
|
||||
## [0.13.1] - 2025-05-21
|
||||
|
||||
### Changed
|
||||
|
||||
- Make dbus envvar available to the agent
|
||||
|
||||
## [0.13.0] - 2025-05-19
|
||||
|
||||
### Added
|
||||
|
||||
- Run dbus
|
||||
|
||||
## [0.12.0] - 2025-05-18
|
||||
|
||||
### Changed
|
||||
|
||||
- no tls for the urlmenu either
|
||||
|
||||
## [0.11.0] - 2025-05-18
|
||||
|
||||
### Added
|
||||
|
||||
- Run stunnel and point the browser to it
|
||||
|
||||
## [0.10.0] - 2025-05-14
|
||||
|
||||
### Changed
|
||||
|
||||
- Run the new browser
|
||||
|
||||
## [0.9.0] - 2025-05-09
|
||||
|
||||
### Added
|
||||
|
||||
- Use zstd when creating and restoring images
|
||||
|
||||
## [0.8.4] - 2025-05-09
|
||||
|
||||
### Added
|
||||
|
||||
- When restoring an image, include the image name in the ogagent configuration file
|
||||
|
||||
## [0.8.3] - 2025-05-08
|
||||
|
||||
### Fixed
|
||||
|
||||
- Have ogNvramAddEntry() handle EFI entries with spaces in them
|
||||
|
||||
## [0.8.2] - 2025-05-07
|
||||
|
||||
### Changed
|
||||
|
||||
- Have Configurar.py ignore the tch parameter, take cache size from the definition of the cache partition
|
||||
|
||||
## [0.8.1] - 2025-05-07
|
||||
|
||||
### Fixed
|
||||
|
||||
- Gracefully handle error in ogBoot() when not finding /boot partition in target's fstab
|
||||
|
||||
## [0.8.0] - 2025-04-23
|
||||
|
||||
### Added
|
||||
|
||||
- Have the oglive agent send /stopped on poweroff or restart
|
||||
|
||||
## [0.7.2] - 2025-04-21
|
||||
|
||||
### Fixed
|
||||
|
||||
- Have the partitioning functions return a meaningful rc
|
||||
|
||||
## [0.7.1] - 2025-04-15
|
||||
|
||||
### Fixed
|
||||
|
||||
- getConfiguration.py: don't fail if NTFS filesystems are mounted ro
|
||||
|
||||
## [0.7.0] - 2025-04-15
|
||||
|
||||
### Removed
|
||||
|
||||
- Removed references to ogGlobals.OGLOG in python code
|
||||
|
||||
## [0.6.1] - 2025-04-15
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed capturing of partclone output and management of return value
|
||||
|
||||
## [0.6.0] - 2025-04-15
|
||||
|
||||
### Changed
|
||||
|
||||
- ogGetIpAddress() is no longer required in ogGlobals--move it back into NetLib
|
||||
|
||||
## [0.5.0] - 2025-04-15
|
||||
|
||||
### Changed
|
||||
|
||||
- Log to /var/log/clone-engine.log and clone-engine.json.log
|
||||
|
||||
## [0.4.1] - 2025-04-10
|
||||
|
||||
### Fixed
|
||||
|
||||
- restoreImage.py: return negated rc to the shell
|
||||
|
||||
## [0.4.0] - 2025-04-10
|
||||
|
||||
### Changed
|
||||
|
||||
- Make /opt/opengnsys writable in clients, just like it used to be
|
||||
|
||||
## [0.3.6] - 2025-04-09
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed ogReduceFs
|
||||
|
||||
## [0.3.5] - 2025-04-09
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed syntax
|
||||
|
||||
## [0.3.4] - 2025-04-09
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed usage of ogEcho in FileSystemLib
|
||||
|
||||
## [0.3.3] - 2025-04-09
|
||||
|
||||
### Fixed
|
||||
|
||||
- Kill coproc'ed browser in all execution branches in Configurar.py
|
||||
|
||||
## [0.3.2] - 2025-04-07
|
||||
|
||||
### Fixed
|
||||
|
||||
- Handle invalid number of arguments pass to functions/ogCopyFile
|
||||
|
||||
## [0.3.1] - 2025-04-03
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed invocation to ogCheckIpAddress in interfaceAdm/CrearImagen.py
|
||||
|
||||
## [0.3.0] - 2025-04-03
|
||||
|
||||
### Removed
|
||||
|
||||
- Removed burg and rsync 3.1
|
||||
|
||||
## [0.2.6] - 2025-03-31
|
||||
|
||||
### Fixed
|
||||
|
||||
- Restore qt4 browser
|
||||
|
||||
## [0.2.5] - 2025-03-31
|
||||
|
||||
### Fixed
|
||||
|
||||
- Don't require protoopts in interfaceAdm/RestaurarImagen.py
|
||||
|
||||
## [0.2.4] - 2025-03-28
|
||||
|
||||
### Removed
|
||||
|
||||
- Removed burg, QT4 stuff, rsync 3.1 and the old browser
|
||||
|
||||
## [0.2.3] - 2025-03-28
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed some errors in Configurar.py, ogCreateCache, ogCreatePartitions and initCache.py
|
||||
|
||||
## [0.2.2] - 2025-03-26
|
||||
|
||||
### Fixed
|
||||
|
||||
- Prevent EjecutarScript.py from capturing the output of the script
|
||||
|
||||
## [0.2.1] - 2025-03-26
|
||||
|
||||
### Fixed
|
||||
|
||||
- Run scripts with bash to avoid errno 8 "Exec format error"
|
||||
|
||||
## [0.2.0] - 2025-03-25
|
||||
|
||||
### Added
|
||||
|
||||
- getConfiguration.py now collects the firmware type
|
||||
- Configurar.py now creates partition tables of the right type (MSDOS/GPT) for each machine
|
||||
|
||||
## [0.1.1] - 2025-03-19
|
||||
|
||||
### Added
|
||||
|
||||
- Missing functions in BootLib
|
||||
- Some interfaceAdm python scripts
|
||||
|
||||
# Changelog
|
||||
## [0.1.0] - 2025-02-28
|
||||
|
||||
### Added
|
||||
### Addded
|
||||
|
||||
- Merge pull request 'Include all client files, build debian package' (#2) from deb-package into main
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ pipeline {
|
|||
stage('Prepare Workspace') {
|
||||
steps {
|
||||
script {
|
||||
env.BUILD_DIR = "${WORKSPACE}/ogclient"
|
||||
env.BUILD_DIR = "${WORKSPACE}/oggui"
|
||||
sh "mkdir -p ${env.BUILD_DIR}"
|
||||
}
|
||||
}
|
||||
|
@ -48,50 +48,16 @@ pipeline {
|
|||
}
|
||||
}
|
||||
}
|
||||
stage('Generate Changelog (Nightly)'){
|
||||
when {
|
||||
branch 'main'
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
def devName = params.DEV_NAME ? params.DEV_NAME : env.DEFAULT_DEV_NAME
|
||||
def devEmail = params.DEV_EMAIL ? params.DEV_EMAIL : env.DEFAULT_DEV_EMAIL
|
||||
generateDebianChangelog(env.BUILD_DIR, devName, devEmail,"nightly")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build') {
|
||||
steps {
|
||||
script {
|
||||
construirPaquete(env.BUILD_DIR, "../artifacts", "172.17.8.68", "/var/tmp/opengnsys/debian-repo/ogclient")
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ('Publish to Debian Repository') {
|
||||
when {
|
||||
expression {
|
||||
return env.TAG_NAME != null
|
||||
}
|
||||
}
|
||||
agent { label 'debian-repo' }
|
||||
steps {
|
||||
script {
|
||||
// Construir el patrón de versión esperado en el nombre del paquete
|
||||
def versionPattern = "${env.TAG_NAME}-${env.BUILD_NUMBER}"
|
||||
publicarEnAptly('/var/tmp/opengnsys/debian-repo/ogclient', 'opengnsys-devel', versionPattern)
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ('Publish to Debian Repository (Nightly)') {
|
||||
when {
|
||||
branch 'main'
|
||||
}
|
||||
agent { label 'debian-repo' }
|
||||
steps {
|
||||
script {
|
||||
// Construir el patrón de versión esperado en el nombre del paquete
|
||||
def versionPattern = "-${env.BUILD_NUMBER}~nightly"
|
||||
publicarEnAptly('/var/tmp/opengnsys/debian-repo/ogclient', 'nightly', versionPattern)
|
||||
dir("${env.BUILD_DIR}") {
|
||||
sh '''
|
||||
dpkg-buildpackage -us -uc
|
||||
mkdir -p ../artifacts && mv ../*.deb ../*.changes ../*.buildinfo ../artifacts/
|
||||
ssh aptly@172.17.8.68 "rm -rf /var/tmp/opengnsys/debian-repo && mkdir -p /var/tmp/opengnsys/debian-repo"
|
||||
scp -r ../artifacts/* aptly@172.17.8.68:/var/tmp/opengnsys/debian-repo/
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -102,4 +68,10 @@ pipeline {
|
|||
}
|
||||
}
|
||||
}
|
||||
// stage ('Publish to Debian Repository') {
|
||||
// agent { label 'debian-repo' }
|
||||
// steps {
|
||||
// sh "aptly repo add opengnsys-devel /var/tmp/opengnsys/debian-repo/*.deb"
|
||||
// }
|
||||
// }
|
||||
|
||||
|
|
|
@ -23,7 +23,13 @@ case "$1" in
|
|||
cp -a "$OLD_FILE" "$NEW_FILE"
|
||||
|
||||
# Append our configuration
|
||||
echo "include = /etc/samba/smb-ogclient.conf" >> "$OLD_FILE"
|
||||
echo "include = /etc/samba/smb-ogclient.conf" >> "$NEW_FILE"
|
||||
|
||||
# Use ucf to handle the file update
|
||||
ucf --debconf-ok "$NEW_FILE" "$OLD_FILE"
|
||||
|
||||
# Clean up
|
||||
rm -f "$NEW_FILE"
|
||||
|
||||
# Reload Samba
|
||||
if command -v systemctl >/dev/null 2>&1; then
|
||||
|
@ -42,8 +48,6 @@ case "$1" in
|
|||
;;
|
||||
esac
|
||||
|
||||
chown -R opengnsys:opengnsys /opt/opengnsys/ogclient
|
||||
chown -R opengnsys:opengnsys /opt/opengnsys/ogclient_log
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# Asegurarse de que el usuario exista
|
||||
USER="opengnsys"
|
||||
HOME_DIR="/opt/opengnsys"
|
||||
if id "$USER" &>/dev/null; then
|
||||
echo "El usuario $USER ya existe."
|
||||
else
|
||||
echo "Creando el usuario $USER con home en $HOME_DIR."
|
||||
useradd -m -d "$HOME_DIR" -s /bin/bash "$USER"
|
||||
fi
|
||||
|
||||
exit 0
|
|
@ -1,7 +1,7 @@
|
|||
[ogclient]
|
||||
comment = OpenGnsys Client
|
||||
browseable = no
|
||||
writeable = yes
|
||||
writeable = no
|
||||
locking = no
|
||||
path = /opt/opengnsys/ogclient
|
||||
guest ok = no
|
||||
|
|
Binary file not shown.
|
@ -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'])
|
|
@ -0,0 +1,40 @@
|
|||
#!/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_IP=$ogcore
|
||||
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
|
||||
echo "exec /usr/bin/OGBrowser $OGMENU" > /home/root/
|
||||
/usr/bin/OGBrowser -qws $OGMENU
|
||||
fi
|
||||
|
||||
# Si fallo en cliente y modo "admin", cargar shell; si no, salir.
|
||||
if [ "$ogactiveadmin" == "true" ]; then
|
||||
bash
|
||||
fi
|
|
@ -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'])
|
|
@ -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 fileslinks loadmodules metadevs mountrepo poweroff otherservices; do
|
||||
$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
|
|
@ -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
|
||||
|
|
@ -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
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
#!/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
|
||||
#*/
|
||||
|
||||
# Montar efivar filesystem
|
||||
ogIsEfiActive && mount -t efivarfs none /sys/firmware/efi/efivars
|
||||
|
||||
# Lanzar servicios complementarios del cliente.
|
||||
echo "${MSG_OTHERSERVICES:-.}"
|
||||
|
||||
# Iniciar rsyslog, si es necesario.
|
||||
[ -S /dev/log ] || service rsyslog start
|
||||
|
||||
# Adpatar la clave de "root" para acceso SSH.
|
||||
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
|
||||
# Cargar el entorno OpenGnsys en conexión SSH.
|
||||
cp -a $OPENGNSYS/etc/preinit/loadenviron.sh /etc/profile.d/
|
||||
# Arrancar SSH.
|
||||
/etc/init.d/ssh start &>/dev/null
|
||||
|
||||
# Desactivado apagado de monitor.
|
||||
#setterm -blank 0 -powersave off -powerdown 0 < /dev/console > /dev/console 2>&1
|
||||
|
||||
# Activado WOL en la interfaz usada en arranque PXE.
|
||||
ethtool -s $DEVICE wol g 2>/dev/null
|
||||
|
||||
# TODO Localizar correctamente el script de arranque.
|
||||
[ -f /opt/opengnsys/scripts/runhttplog.sh ] && /opt/opengnsys/scripts/runhttplog.sh 2>/dev/null
|
||||
|
||||
|
|
@ -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
|
||||
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import sys
|
||||
import argparse
|
||||
from SystemLib import ogHelp
|
||||
from BootLib import ogBoot
|
||||
|
||||
if 2 == len (sys.argv) and 'help' == sys.argv[1]:
|
||||
#parser.print_help() sale en inglés aunque la locale indique otra cosa
|
||||
ogHelp ('ogBoot', 'ogBoot int_ndisk int_nfilesys [ NVRAMPERM ] [str_kernel str_initrd str_kernelparams]', ['ogBoot 1 2 "/boot/vmlinuz /boot/initrd.img root=/dev/sda2 ro"', 'ogBoot 1 2 NVRAMPERM'])
|
||||
sys.exit (0)
|
||||
|
||||
parser = argparse.ArgumentParser (add_help=False)
|
||||
if 3 == len (sys.argv):
|
||||
parser.add_argument ('disk')
|
||||
parser.add_argument ('par')
|
||||
elif 4 == len (sys.argv):
|
||||
parser.add_argument ('disk')
|
||||
parser.add_argument ('par')
|
||||
parser.add_argument ('nvramperm_or_params')
|
||||
elif 5 == len (sys.argv):
|
||||
parser.add_argument ('disk')
|
||||
parser.add_argument ('par')
|
||||
parser.add_argument ('nvramperm')
|
||||
parser.add_argument ('params')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if 3 == len (sys.argv):
|
||||
ret = ogBoot (args.disk, args.par)
|
||||
elif 4 == len (sys.argv):
|
||||
if 'NVRAMPERM' == args.nvramperm_or_params.upper():
|
||||
nvramperm = True
|
||||
params = ''
|
||||
else:
|
||||
nvramperm = False
|
||||
params = args.nvramperm_or_params
|
||||
ret = ogBoot (args.disk, args.par, nvramperm, params)
|
||||
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)
|
||||
else: print (ret)
|
|
@ -1,27 +0,0 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import sys
|
||||
import argparse
|
||||
import ogGlobals
|
||||
from SystemLib import ogHelp
|
||||
from BootLib import ogBootLoaderDefaultEntry
|
||||
|
||||
parser = argparse.ArgumentParser (add_help=False)
|
||||
parser.add_argument ('disk')
|
||||
parser.add_argument ('par')
|
||||
parser.add_argument ('diskdefault')
|
||||
parser.add_argument ('pardefault')
|
||||
|
||||
if 2 == len (sys.argv) and 'help' == sys.argv[1]:
|
||||
#parser.print_help() sale en inglés aunque la locale indique otra cosa
|
||||
ogHelp ('ogBootLoaderDefaultEntry', ogGlobals.lang.MSG_SEE+' ogGrubDefaultEntry', [])
|
||||
sys.exit (0)
|
||||
|
||||
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)
|
||||
else: print (ret)
|
|
@ -1,27 +0,0 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import sys
|
||||
import argparse
|
||||
import ogGlobals
|
||||
from SystemLib import ogHelp
|
||||
from BootLib import ogBootLoaderDeleteEntry
|
||||
|
||||
parser = argparse.ArgumentParser (add_help=False)
|
||||
parser.add_argument ('disk')
|
||||
parser.add_argument ('par')
|
||||
parser.add_argument ('diskdel')
|
||||
parser.add_argument ('pardel')
|
||||
|
||||
if 2 == len (sys.argv) and 'help' == sys.argv[1]:
|
||||
#parser.print_help() sale en inglés aunque la locale indique otra cosa
|
||||
ogHelp ('ogBootLoaderDeleteEntry', ogGlobals.lang.MSG_SEE+' ogGrubDeleteEntry', [])
|
||||
sys.exit (0)
|
||||
|
||||
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)
|
||||
else: print (ret)
|
|
@ -1,34 +0,0 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import sys
|
||||
import argparse
|
||||
import ogGlobals
|
||||
from SystemLib import ogHelp
|
||||
from BootLib import ogBootLoaderHidePartitions
|
||||
|
||||
if 2 == len (sys.argv) and 'help' == sys.argv[1]:
|
||||
#parser.print_help() sale en inglés aunque la locale indique otra cosa
|
||||
ogHelp ('ogBootLoaderHidePartitions', ogGlobals.lang.MSG_SEE+' ogGrubHidePartitions', [])
|
||||
sys.exit (0)
|
||||
|
||||
parser = argparse.ArgumentParser (add_help=False)
|
||||
if 3 == len (sys.argv):
|
||||
parser.add_argument ('disk')
|
||||
parser.add_argument ('par')
|
||||
elif 5 == len (sys.argv):
|
||||
parser.add_argument ('disk')
|
||||
parser.add_argument ('par')
|
||||
parser.add_argument ('datadisk')
|
||||
parser.add_argument ('datapar')
|
||||
|
||||
args = parser.parse_args()
|
||||
if 3 == len (sys.argv):
|
||||
ret = ogBootLoaderHidePartitions (args.disk, args.par)
|
||||
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)
|
||||
else: print (ret)
|
|
@ -1,25 +0,0 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import sys
|
||||
import argparse
|
||||
import ogGlobals
|
||||
from SystemLib import ogHelp
|
||||
from BootLib import ogBootLoaderOgliveDefaultEntry
|
||||
|
||||
parser = argparse.ArgumentParser (add_help=False)
|
||||
parser.add_argument ('disk')
|
||||
parser.add_argument ('par')
|
||||
|
||||
if 2 == len (sys.argv) and 'help' == sys.argv[1]:
|
||||
#parser.print_help() sale en inglés aunque la locale indique otra cosa
|
||||
ogHelp ('ogBootLoaderOgliveDefaultEntry', ogGlobals.lang.MSG_SEE+' ogGrubOgliveDefaultEntry', [])
|
||||
sys.exit (0)
|
||||
|
||||
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)
|
||||
else: print (ret)
|
|
@ -1,26 +0,0 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import sys
|
||||
import argparse
|
||||
import ogGlobals
|
||||
from SystemLib import ogHelp
|
||||
from BootLib import ogBootLoaderSetTimeOut
|
||||
|
||||
parser = argparse.ArgumentParser (add_help=False)
|
||||
parser.add_argument ('disk')
|
||||
parser.add_argument ('par')
|
||||
parser.add_argument ('timeout')
|
||||
|
||||
if 2 == len (sys.argv) and 'help' == sys.argv[1]:
|
||||
#parser.print_help() sale en inglés aunque la locale indique otra cosa
|
||||
ogHelp ('ogBootLoaderSetTimeOut', ogGlobals.lang.MSG_SEE+' ogGrubSetTimeOut', [])
|
||||
sys.exit (0)
|
||||
|
||||
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)
|
||||
else: print (ret)
|
|
@ -1,23 +0,0 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import sys
|
||||
import argparse
|
||||
from SystemLib import ogHelp
|
||||
from BootLib import ogBootMbrXP
|
||||
|
||||
parser = argparse.ArgumentParser (add_help=False)
|
||||
parser.add_argument ('disk')
|
||||
|
||||
if 2 == len (sys.argv) and 'help' == sys.argv[1]:
|
||||
#parser.print_help() sale en inglés aunque la locale indique otra cosa
|
||||
ogHelp ('ogBootMbrXP', 'ogBootMbrXP int_ndisk', ['ogBootMbrXP 1'])
|
||||
sys.exit (0)
|
||||
|
||||
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)
|
||||
else: print (ret)
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -7,6 +7,7 @@ from NetLib import ogChangeRepo
|
|||
|
||||
parser = argparse.ArgumentParser (add_help=False)
|
||||
parser.add_argument ('ip_repo')
|
||||
parser.add_argument ('og_unit', nargs='?', default=None)
|
||||
|
||||
if 2 == len (sys.argv) and 'help' == sys.argv[1]:
|
||||
#parser.print_help() sale en inglés aunque la locale indique otra cosa
|
||||
|
@ -15,8 +16,7 @@ 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)
|
||||
ret = ogChangeRepo (args.ip_repo, args.og_unit)
|
||||
if ret is not None:
|
||||
if ret == True: sys.exit (0)
|
||||
elif ret == False: sys.exit (1)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -19,7 +19,6 @@ if 5 == len (sys.argv):
|
|||
args = parser.parse_args()
|
||||
src = { 'container': args.src_container, 'file': args.src_file }
|
||||
dst = { 'container': args.dst_container, 'file': args.dst_file }
|
||||
|
||||
elif 7 == len (sys.argv):
|
||||
parser.add_argument ('src_disk')
|
||||
parser.add_argument ('src_par')
|
||||
|
@ -30,31 +29,6 @@ elif 7 == len (sys.argv):
|
|||
args = parser.parse_args()
|
||||
src = { 'disk': args.src_disk, 'par': args.src_par, 'file': args.src_file }
|
||||
dst = { 'disk': args.dst_disk, 'par': args.dst_par, 'file': args.dst_file }
|
||||
|
||||
elif 4 == len (sys.argv):
|
||||
## can be either:
|
||||
## - src_container src_file dst_file
|
||||
## - src_file dst_container dst_file
|
||||
if 'REPO' == sys.argv[1] or 'CACHE' == sys.argv[1]:
|
||||
## we are in "src_container src_file dst_file"
|
||||
parser.add_argument ('src_container')
|
||||
parser.add_argument ('src_file')
|
||||
parser.add_argument ('dst_file')
|
||||
args = parser.parse_args()
|
||||
src = { 'container': args.src_container, 'file': args.src_file }
|
||||
dst = { 'file': args.dst_file }
|
||||
elif 'REPO' == sys.argv[2] or 'CACHE' == sys.argv[2]:
|
||||
## we are in "src_file dst_container dst_file"
|
||||
parser.add_argument ('src_file')
|
||||
parser.add_argument ('dst_container')
|
||||
parser.add_argument ('dst_file')
|
||||
args = parser.parse_args()
|
||||
src = { 'file': args.src_file }
|
||||
dst = { 'container': args.dst_container, 'file': args.dst_file }
|
||||
else:
|
||||
ogHelp ('ogCopyFile', 'ogCopyFile [ str_repo | int_ndisk int_npartition ] path_source [ str_repo | int_ndisk int_npartition ] path_target', ['ogCopyFile REPO newfile.txt 1 2 /tmp/newfile.txt'])
|
||||
sys.exit (1)
|
||||
|
||||
elif 6 == len (sys.argv):
|
||||
## can be either:
|
||||
## - src_disk src_par src_file dst_container dst_file
|
||||
|
@ -62,7 +36,7 @@ elif 6 == len (sys.argv):
|
|||
|
||||
try:
|
||||
num = int (sys.argv[1]) ## raises ValueError if sys.argv[1] doesn't look like a number
|
||||
## we are in "src_disk src_par src_file dst_container dst_file"
|
||||
## "src_disk src_par src_file dst_container dst_file"
|
||||
parser.add_argument ('src_disk')
|
||||
parser.add_argument ('src_par')
|
||||
parser.add_argument ('src_file')
|
||||
|
@ -72,7 +46,7 @@ elif 6 == len (sys.argv):
|
|||
src = { 'disk': args.src_disk, 'par': args.src_par, 'file': args.src_file }
|
||||
dst = { 'container': args.dst_container, 'file': args.dst_file }
|
||||
except:
|
||||
## we are in "src_container src_file dst_disk dst_par dst_file"
|
||||
## "src_container src_file dst_disk dst_par dst_file"
|
||||
parser.add_argument ('src_container')
|
||||
parser.add_argument ('src_file')
|
||||
parser.add_argument ('dst_disk')
|
||||
|
@ -81,12 +55,8 @@ elif 6 == len (sys.argv):
|
|||
args = parser.parse_args()
|
||||
src = { 'container': args.src_container, 'file': args.src_file }
|
||||
dst = { 'disk': args.dst_disk, 'par': args.dst_par, 'file': args.dst_file }
|
||||
else:
|
||||
ogHelp ('ogCopyFile', 'ogCopyFile [ str_repo | int_ndisk int_npartition ] path_source [ str_repo | int_ndisk int_npartition ] path_target', ['ogCopyFile REPO newfile.txt 1 2 /tmp/newfile.txt'])
|
||||
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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -3,20 +3,20 @@
|
|||
import sys
|
||||
import argparse
|
||||
from SystemLib import ogHelp
|
||||
from BootLib import ogBootMbrGeneric
|
||||
|
||||
parser = argparse.ArgumentParser (add_help=False)
|
||||
parser.add_argument ('disk')
|
||||
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 ('ogBootMbrGeneric', 'ogBootMbrGeneric int_ndisk', ['ogBootMbrGeneric 1'])
|
||||
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 = ogBootMbrGeneric (args.disk)
|
||||
|
||||
if ret is None: sys.exit (1)
|
||||
ret = ogCreateGptPartitions (args.disk, args.parts)
|
||||
|
||||
if ret is not None:
|
||||
if ret == True: sys.exit (0)
|
||||
elif ret == False: sys.exit (1)
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import sys
|
||||
import argparse
|
||||
from SystemLib import ogHelp
|
||||
from BootLib import ogGetBootMbr
|
||||
|
||||
parser = argparse.ArgumentParser (add_help=False)
|
||||
parser.add_argument ('disk')
|
||||
|
||||
if 2 == len (sys.argv) and 'help' == sys.argv[1]:
|
||||
#parser.print_help() sale en inglés aunque la locale indique otra cosa
|
||||
ogHelp ('ogGetBootMbr', 'ogGetBootMbr int_ndisk', ['ogGetBootMbr 1'])
|
||||
sys.exit (0)
|
||||
|
||||
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)
|
||||
else: print (ret)
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import sys
|
||||
import argparse
|
||||
from SystemLib import ogHelp
|
||||
from BootLib import ogGetWindowsName
|
||||
|
||||
parser = argparse.ArgumentParser (add_help=False)
|
||||
parser.add_argument ('disk')
|
||||
parser.add_argument ('par')
|
||||
|
||||
if 2 == len (sys.argv) and 'help' == sys.argv[1]:
|
||||
#parser.print_help() sale en inglés aunque la locale indique otra cosa
|
||||
ogHelp ('ogGetWindowsName', 'ogGetWindowsName int_ndisk int_npartition', ['ogGetWindowsName 1 1'])
|
||||
sys.exit (0)
|
||||
|
||||
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)
|
||||
else: print (ret)
|
|
@ -1,24 +0,0 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import sys
|
||||
import argparse
|
||||
from SystemLib import ogHelp
|
||||
from BootLib import ogGrub4dosInstallMbr
|
||||
|
||||
parser = argparse.ArgumentParser (add_help=False)
|
||||
parser.add_argument ('disk')
|
||||
parser.add_argument ('par')
|
||||
|
||||
if 2 == len (sys.argv) and 'help' == sys.argv[1]:
|
||||
#parser.print_help() sale en inglés aunque la locale indique otra cosa
|
||||
ogHelp ('ogGrub4dosInstallMbr', 'ogGrub4dosInstallMbr int_ndisk int_part', ['ogGrub4dosInstallMbr 1 1'])
|
||||
sys.exit (0)
|
||||
|
||||
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)
|
||||
else: print (ret)
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue