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