From f13a22b745f948ae9d1aeb67ec6056794c178cb2 Mon Sep 17 00:00:00 2001 From: Jacob Hrbek Date: Wed, 22 Jul 2020 20:06:09 +0200 Subject: [PATCH] stub --- .../downstream-classes/zeres-0/bash/README.md | 2 + .../bash/{zernit.bashrc => UNLEASH.sh} | 14 +- .../zeres-0/bash/wrappers/README.md | 5 + .../zeres-0/bash/wrappers/cmd_check.sh | 57 +++++++ .../zeres-0/bash/wrappers/emkdir.sh | 37 +++++ .../bash/wrappers/invoke_privileged.sh | 156 ++++++++++++++++++ .../packages/test/test/example-database.json | 24 ++- .../packages/test/test/something.sh.1 | 2 - 8 files changed, 292 insertions(+), 5 deletions(-) rename src/RXT0112-1/downstream-classes/zeres-0/bash/{zernit.bashrc => UNLEASH.sh} (96%) create mode 100644 src/RXT0112-1/downstream-classes/zeres-0/bash/wrappers/README.md create mode 100644 src/RXT0112-1/downstream-classes/zeres-0/bash/wrappers/cmd_check.sh create mode 100644 src/RXT0112-1/downstream-classes/zeres-0/bash/wrappers/emkdir.sh create mode 100644 src/RXT0112-1/downstream-classes/zeres-0/bash/wrappers/invoke_privileged.sh diff --git a/src/RXT0112-1/downstream-classes/zeres-0/bash/README.md b/src/RXT0112-1/downstream-classes/zeres-0/bash/README.md index 33bdb72..84d1c0f 100644 --- a/src/RXT0112-1/downstream-classes/zeres-0/bash/README.md +++ b/src/RXT0112-1/downstream-classes/zeres-0/bash/README.md @@ -1,3 +1,5 @@ # Zeres-0 (Bash) This directory contains logic for zeres-0 to process standardized bash/shell downstream + +The `UNLEASH` file is the first thing invoked by zernit diff --git a/src/RXT0112-1/downstream-classes/zeres-0/bash/zernit.bashrc b/src/RXT0112-1/downstream-classes/zeres-0/bash/UNLEASH.sh similarity index 96% rename from src/RXT0112-1/downstream-classes/zeres-0/bash/zernit.bashrc rename to src/RXT0112-1/downstream-classes/zeres-0/bash/UNLEASH.sh index 69c1db1..3148fd9 100644 --- a/src/RXT0112-1/downstream-classes/zeres-0/bash/zernit.bashrc +++ b/src/RXT0112-1/downstream-classes/zeres-0/bash/UNLEASH.sh @@ -1,5 +1,5 @@ #!/bin/sh -# All rights reserved by Jacob Hrbek in 04/2020 +# All rights reserved by Jacob Hrbek in 04/2020 (Prepared for four freedom respecting license) # Peer-reviewed by: in # shellcheck shell=sh @@ -291,6 +291,18 @@ else die 255 "Identifying system" fi +# Define hostname +# NOTICE: Variable 'HOSTNAME' is not defined on POSIX sh +if command -v hostname 1>/dev/null; then + HOSTNAME="$(hostname)" +elif [ -s /etc/hostname ]; then + HOSTNAME="$(cat /etc/hostname)" +elif ! command -v hostname 1>/dev/null && [ ! -s /etc/hostname ]; then + die false "Unable to determine the hostname from command 'hostname' (which doesn't exists) and from file /etc/hostname (that doesn't exists or is blank)" +else + die unexpected "processing hostname" +fi + # Argument management while [ "$#" -gt 0 ]; do case "$1" in install-deps) diff --git a/src/RXT0112-1/downstream-classes/zeres-0/bash/wrappers/README.md b/src/RXT0112-1/downstream-classes/zeres-0/bash/wrappers/README.md new file mode 100644 index 0000000..8b90bd1 --- /dev/null +++ b/src/RXT0112-1/downstream-classes/zeres-0/bash/wrappers/README.md @@ -0,0 +1,5 @@ +# Wrappers + +Directory dedicated to various wrapper functions + +Wrapper meaning that they wrap another function to handle it's functionality diff --git a/src/RXT0112-1/downstream-classes/zeres-0/bash/wrappers/cmd_check.sh b/src/RXT0112-1/downstream-classes/zeres-0/bash/wrappers/cmd_check.sh new file mode 100644 index 0000000..3a87a4a --- /dev/null +++ b/src/RXT0112-1/downstream-classes/zeres-0/bash/wrappers/cmd_check.sh @@ -0,0 +1,57 @@ +#!/bin/false +# - Used only for sourcing +# Created by Jacob Hrbek as All Rights Reserved in 08.07.2020 03:32:02 CET +# Peer-reviewed by in