From d0c8f026f9d507011acf8672fa5f68922cddbc8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Fri, 26 Apr 2024 04:32:38 +0300 Subject: [PATCH] Source Update --- src/base.sh | 50 +++++++++++++++++++++++++++++++++++++ src/commands/auth/login.sh | 3 +++ src/commands/auth/logout.sh | 3 +++ src/commands/help.sh | 22 ++++++++++++++++ src/commands/install.sh | 3 +++ src/commands/settings.sh | 3 +++ src/commands/ssh.sh | 3 +++ src/commands/ssh/config.sh | 3 +++ src/commands/ssh/sign.sh | 3 +++ 9 files changed, 93 insertions(+) create mode 100644 src/base.sh create mode 100644 src/commands/auth/login.sh create mode 100644 src/commands/auth/logout.sh create mode 100644 src/commands/help.sh create mode 100644 src/commands/install.sh create mode 100644 src/commands/settings.sh create mode 100644 src/commands/ssh.sh create mode 100644 src/commands/ssh/config.sh create mode 100644 src/commands/ssh/sign.sh diff --git a/src/base.sh b/src/base.sh new file mode 100644 index 0000000..dc8fd5d --- /dev/null +++ b/src/base.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +if [ ! "$BASH_VERSION" ] ; then + bash $0 $1 $2 $3 $4 $5 $6 $7 $8 $9 + exit 1 +fi + +warencli-syntax-line-douple() { +echo -n " +============================== +" +} + +warencli-syntax-line-single() { +echo -n " +------------------------------ +" +} + +warencli-start() { +warencli-syntax-line-douple +echo -n "Warén CLI " +warencli-syntax-line-douple +} + +warencli-stop () { + echo " " + echo " " + exit 1 +} + +warencli-update() { +if [[ -d "./src" ]]; then + echo ">>> Building... <<<" + podman run -it --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp docker.io/library/php:8-cli php generator.php +else + cd /opt/wx + curl +fi +} + +{{ COMMANDS }} + +COMMAND=$1 + +warencli-start +if [[ ! -z $1 ]]; then + warencli-$1 $2 $3 $4 $5 $6 $7 $8 $9 +fi +warencli-stop diff --git a/src/commands/auth/login.sh b/src/commands/auth/login.sh new file mode 100644 index 0000000..2571d85 --- /dev/null +++ b/src/commands/auth/login.sh @@ -0,0 +1,3 @@ +warencli-login() { +echo ">>> Authentication: Login"; +} diff --git a/src/commands/auth/logout.sh b/src/commands/auth/logout.sh new file mode 100644 index 0000000..848cdc2 --- /dev/null +++ b/src/commands/auth/logout.sh @@ -0,0 +1,3 @@ +warencli-logout() { +echo ">>> Authentication: Logout"; +} diff --git a/src/commands/help.sh b/src/commands/help.sh new file mode 100644 index 0000000..f9d2b15 --- /dev/null +++ b/src/commands/help.sh @@ -0,0 +1,22 @@ +warencli-help() { +echo " +Usage: $0 COMMAND [OPTIONS] + +Common Commands: + ssh SSH + config Config + sign Certificates + +Authentication Commands: + login Login + logout Logout + +Management Commands: + settings Settings + +Maintenance Commands: + install Install + update Update +"; +} + diff --git a/src/commands/install.sh b/src/commands/install.sh new file mode 100644 index 0000000..6ebf57b --- /dev/null +++ b/src/commands/install.sh @@ -0,0 +1,3 @@ +warencli-install() { +echo ">>> Install"; +} diff --git a/src/commands/settings.sh b/src/commands/settings.sh new file mode 100644 index 0000000..868a205 --- /dev/null +++ b/src/commands/settings.sh @@ -0,0 +1,3 @@ +warencli-settings() { +echo ">>> Settings"; +} diff --git a/src/commands/ssh.sh b/src/commands/ssh.sh new file mode 100644 index 0000000..54509d6 --- /dev/null +++ b/src/commands/ssh.sh @@ -0,0 +1,3 @@ +warencli-ssh() { +echo ">>> SSH"; +} diff --git a/src/commands/ssh/config.sh b/src/commands/ssh/config.sh new file mode 100644 index 0000000..928ca8d --- /dev/null +++ b/src/commands/ssh/config.sh @@ -0,0 +1,3 @@ +warencli-ssh-config(){ +echo ">>> SSH: Config" +} diff --git a/src/commands/ssh/sign.sh b/src/commands/ssh/sign.sh new file mode 100644 index 0000000..5ffc5f2 --- /dev/null +++ b/src/commands/ssh/sign.sh @@ -0,0 +1,3 @@ +warencli-ssh-sign(){ +echo ">>> SSH: Certificates" +}