From e075997e4c369dd8c19a887c797b50d6fee24790 Mon Sep 17 00:00:00 2001 From: David Kebler Date: Wed, 21 Feb 2024 14:47:54 -0800 Subject: [PATCH] move remote uci install to own file add login shell and environment variable options to remote --- modules/install-shell-base.sh | 30 ------------- modules/remote-uci-install | 40 ++++++++++++++++++ modules/remote.mod | 80 +++++++++++++---------------------- 3 files changed, 69 insertions(+), 81 deletions(-) delete mode 100644 modules/install-shell-base.sh create mode 100644 modules/remote-uci-install diff --git a/modules/install-shell-base.sh b/modules/install-shell-base.sh deleted file mode 100644 index 400e440..0000000 --- a/modules/install-shell-base.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -# assumes that bash is installed -#!/bin/bash -# must! be run as sudo - -install_shell_base () { - # TODO have a cross distro package install - module_load distro - set_distro - - [[ ! $(command -v git) ]] && echo git must be installed first && $INSTALL_PKGS git - # TODO, avoid which in all scripts. or put which in environment if not on machine - [[ ! $(command -v which) ]] && echo 'which' must be installed first && $INSTALL_PKGS which - echo $USER, $EUID - [[ ! $EUID -eq 0 ]] && { echo ERROR script must be run as root; return 2; } - echo I am ROOT, now running script - echo UCI user: $1 - # TODO make the repo and clone values dynamic or bundle current base on sending machine a archive - mkdir -p /shell/base - git clone https://git.kebler.net/bash/shell-base.git /shell/base - chown -R ${1:-$1000}:${1:-1000} /shell - chmod -R +r /shell - - /bin/bash /shell/base/install/install.sh ${1:-1000} -} - -# # if script was executed then call the function - ( return 0 2>/dev/null ) || install_shell_base $@ - - diff --git a/modules/remote-uci-install b/modules/remote-uci-install new file mode 100644 index 0000000..9d5c38d --- /dev/null +++ b/modules/remote-uci-install @@ -0,0 +1,40 @@ +#!/bin/bash +module_load remote +# remote_install_shell_base