diff --git a/init.sh b/init.sh index b9b3fbd..d0df228 100755 --- a/init.sh +++ b/init.sh @@ -17,27 +17,27 @@ wiBold=$(tput bold) wiNormal=$(tput sgr0) wi-header(){ - wx-header $1 $2 + wx-header "$1" $2 } wi-repeat(){ - wx-repeat $1 $2 + wx-repeat "$1" "$2" } wi-login(){ - wx-login $1 $2 + wx-login "$1" "$2" +} + +wx-start(){ + wi-start } wx-stop(){ wi-stop } -wi-delete(){ - if [[ -f "init.sh" ]] - then - rm init.sh - fi -} +wxBold=$wiBold +wxNormal=$wiNormal wx-header(){ if [[ $2 == "h1" ]] @@ -109,7 +109,7 @@ wi-init(){ export HVT=${config["login",$ORG]} - /opt/ansible/bin/ansible-galaxy collection install ansible.posix ansible.utils community.crypto community.docker community.general community.hashi_vault community.libvirt community.mysql community.postgresql containers.podman --upgrade + /opt/ansible/bin/ansible-galaxy collection install ansible.posix ansible.utils community.crypto community.docker community.general community.hashi_vault community.libvirt community.mysql community.postgresql containers.podman --upgrade &> /dev/null /opt/ansible/bin/ansible-pull -U ssh://git@$GIT_DOMAIN:$GIT_PORT/$GIT_REPOSITORY --vault-password-file ~/.ansible/vault.yml --private-key ~/.ssh/init playbooks/init.yml -t init @@ -117,8 +117,6 @@ wi-init(){ } wx-login(){ - ORG=$1 - if [[ -z "$HOSTNAME" || ${#HOSTNAME} -lt 5 ]] then wx-header "Login" @@ -299,7 +297,7 @@ wx-repeat() { wi-restricted(){ if [[ $USER != "root" && $USER != "local" ]] then - sudo $0 $1 $2 + sudo $1 exit 1 fi } @@ -313,13 +311,10 @@ wi-stop (){ echo " " echo " " - wi-delete - exit 1 } -wi-start -wi-restricted $0 $1 $2 +wi-restricted "$0 $1 $2" wi-init $1 $2 wi-stop diff --git a/src/base.sh b/src/base.sh index a225599..8cb9eb2 100644 --- a/src/base.sh +++ b/src/base.sh @@ -18,7 +18,6 @@ wiNormal=$(tput sgr0) {{ CODES }} -wi-start -wi-restricted $0 $1 $2 +wi-restricted "$0 $1 $2" wi-init $1 $2 wi-stop diff --git a/src/functions/compatibility.sh b/src/functions/compatibility.sh index d3001af..16abfe2 100644 --- a/src/functions/compatibility.sh +++ b/src/functions/compatibility.sh @@ -1,15 +1,22 @@ wi-header(){ - wx-header $1 $2 + wx-header "$1" "$2" } wi-repeat(){ - wx-repeat $1 $2 + wx-repeat "$1" "$2" } wi-login(){ - wx-login $1 $2 + wx-login "$1" "$2" +} + +wx-start(){ + wi-start } wx-stop(){ wi-stop } + +wxBold=$wiBold +wxNormal=$wiNormal diff --git a/src/functions/delete.sh b/src/functions/delete.sh deleted file mode 100644 index d0828d4..0000000 --- a/src/functions/delete.sh +++ /dev/null @@ -1,6 +0,0 @@ -wi-delete(){ - if [[ -f "init.sh" ]] - then - rm init.sh - fi -} diff --git a/src/functions/init.sh b/src/functions/init.sh index a7031dd..827c12e 100644 --- a/src/functions/init.sh +++ b/src/functions/init.sh @@ -43,7 +43,7 @@ wi-init(){ export HVT=${config["login",$ORG]} - /opt/ansible/bin/ansible-galaxy collection install ansible.posix ansible.utils community.crypto community.docker community.general community.hashi_vault community.libvirt community.mysql community.postgresql containers.podman --upgrade + /opt/ansible/bin/ansible-galaxy collection install ansible.posix ansible.utils community.crypto community.docker community.general community.hashi_vault community.libvirt community.mysql community.postgresql containers.podman --upgrade &> /dev/null /opt/ansible/bin/ansible-pull -U ssh://git@$GIT_DOMAIN:$GIT_PORT/$GIT_REPOSITORY --vault-password-file ~/.ansible/vault.yml --private-key ~/.ssh/init playbooks/init.yml -t init diff --git a/src/functions/login.sh b/src/functions/login.sh index a8b3450..b38a333 100644 --- a/src/functions/login.sh +++ b/src/functions/login.sh @@ -1,6 +1,4 @@ wx-login(){ - ORG=$1 - if [[ -z "$HOSTNAME" || ${#HOSTNAME} -lt 5 ]] then wx-header "Login" diff --git a/src/functions/restricted.sh b/src/functions/restricted.sh index d068f18..43839cc 100644 --- a/src/functions/restricted.sh +++ b/src/functions/restricted.sh @@ -1,7 +1,7 @@ wi-restricted(){ if [[ $USER != "root" && $USER != "local" ]] then - sudo $0 $1 $2 + sudo $1 exit 1 fi } diff --git a/src/functions/stop.sh b/src/functions/stop.sh index 9035e1b..e449482 100644 --- a/src/functions/stop.sh +++ b/src/functions/stop.sh @@ -3,7 +3,5 @@ wi-stop (){ echo " " echo " " - wi-delete - exit 1 }