From 54409a41976f9a52a33fd9c436963f1caedfa5e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Mon, 10 Nov 2025 19:48:07 +0200 Subject: [PATCH] FIx typos --- src/commands/management/auto.sh | 2 ++ src/commands/management/settings.sh | 3 +++ src/commands/ssh/keys.sh | 10 +++++----- src/commands/ssh/keys/clean.sh | 4 ++-- src/commands/ssh/keys/sign.sh | 4 ++-- src/commands/ssh/keys/sync.sh | 4 ++-- src/functions/restricted.sh | 4 ++-- wx | 31 +++++++++++++++++------------ 8 files changed, 36 insertions(+), 26 deletions(-) diff --git a/src/commands/management/auto.sh b/src/commands/management/auto.sh index 27e0812..b93d45d 100644 --- a/src/commands/management/auto.sh +++ b/src/commands/management/auto.sh @@ -1,4 +1,6 @@ wx-auto(){ + wx-login &> /dev/null + wxi-header "Auto" wxi-restricted wxi-footer diff --git a/src/commands/management/settings.sh b/src/commands/management/settings.sh index b79e28d..b45068d 100644 --- a/src/commands/management/settings.sh +++ b/src/commands/management/settings.sh @@ -1,4 +1,7 @@ wx-settings(){ + wx-login &> /dev/null + wx-auto &> /dev/null + wxi-header "Settings" wxi-restricted --user wxi-footer diff --git a/src/commands/ssh/keys.sh b/src/commands/ssh/keys.sh index 1e46fd3..78c756a 100644 --- a/src/commands/ssh/keys.sh +++ b/src/commands/ssh/keys.sh @@ -1,18 +1,18 @@ wxi-ssh-keys(){ case ${args['3']} in generate) - wxi-ssh-keys-retrieve - wxi-ssh-keys-generate - wxi-ssh-keys-save + wxi-ssh-keys-retrieve ${args['4']} + wxi-ssh-keys-generate ${args['4']} + wxi-ssh-keys-save ${args['4']} ;; sign) wxi-ssh-keys-sign ;; retrieve) - wxi-ssh-keys-retrieve + wxi-ssh-keys-retrieve ${args['4']} ;; save) - wxi-ssh-keys-save + wxi-ssh-keys-save ${args['4']} ;; sync) wxi-ssh-keys-sync diff --git a/src/commands/ssh/keys/clean.sh b/src/commands/ssh/keys/clean.sh index 5d67440..1cc1461 100644 --- a/src/commands/ssh/keys/clean.sh +++ b/src/commands/ssh/keys/clean.sh @@ -11,11 +11,11 @@ wxi-ssh-keys-clean(){ rm "$HOME/.ssh/keys/$1.sig" &> /dev/null fi else - wx-ssh-keys-clean $ORG + wxi-ssh-keys-clean $ORG if [[ $USERNAME == "cwchristerw" ]] then - wx-ssh-keys-clean warengroup + wxi-ssh-keys-clean warengroup fi for file in ~/.ssh/keys/* diff --git a/src/commands/ssh/keys/sign.sh b/src/commands/ssh/keys/sign.sh index 15eece0..bc1b682 100644 --- a/src/commands/ssh/keys/sign.sh +++ b/src/commands/ssh/keys/sign.sh @@ -2,11 +2,11 @@ wxi-ssh-keys-sign(){ wxi-header "SSH / Keys / Sign" wxi-restricted - wx-ssh-keys-sign-create $ORG sysadmin 3600 + wxi-ssh-keys-sign-create $ORG sysadmin 3600 if [[ $USERNAME == "cwchristerw" ]] then - wx-ssh-keys-sign-create warengroup sysadmin 3600 + wxi-ssh-keys-sign-create warengroup sysadmin 3600 fi wxi-footer } diff --git a/src/commands/ssh/keys/sync.sh b/src/commands/ssh/keys/sync.sh index 333e86c..9ade561 100644 --- a/src/commands/ssh/keys/sync.sh +++ b/src/commands/ssh/keys/sync.sh @@ -6,8 +6,8 @@ wxi-ssh-keys-sync(){ then for name in $(curl https://$VAULT_DOMAIN/v1/cli/metadata/$USERNAME/settings/ssh/keys -X LIST --header "X-Vault-Token: $VAULT_TOKEN" -s | jq -r '.data.keys | @sh' | tr -d \') do - echo $name - wx-ssh-keys-retrieve $name --multiple + wxi-content text $name + wxi-ssh-keys-retrieve $name --multiple done fi wxi-footer diff --git a/src/functions/restricted.sh b/src/functions/restricted.sh index fb8dfe1..9e68ba7 100644 --- a/src/functions/restricted.sh +++ b/src/functions/restricted.sh @@ -28,10 +28,10 @@ wxi-restricted(){ wxi-stop ;; esac - elif [[ $(hostname -d) = *"devices.waren.io" ]] + elif [[ $(hostname -d) == "devices.waren.io" ]] then ORG=warengroup - elif [[ $(hostname -d) = *"devices.christerwaren.fi" ]] + elif [[ $(hostname -d) == "devices.christerwaren.fi" ]] then ORG=cwchristerw fi diff --git a/wx b/wx index ac1c505..2e1d8cf 100755 --- a/wx +++ b/wx @@ -52,10 +52,10 @@ wxi-restricted(){ wxi-stop ;; esac - elif [[ $(hostname -d) = *"devices.waren.io" ]] + elif [[ $(hostname -d) == "devices.waren.io" ]] then ORG=warengroup - elif [[ $(hostname -d) = *"devices.christerwaren.fi" ]] + elif [[ $(hostname -d) == "devices.christerwaren.fi" ]] then ORG=cwchristerw fi @@ -609,6 +609,8 @@ wx-update(){ } wx-auto(){ + wx-login &> /dev/null + wxi-header "Auto" wxi-restricted wxi-footer @@ -628,6 +630,9 @@ wx-clean(){ } wx-settings(){ + wx-login &> /dev/null + wx-auto &> /dev/null + wxi-header "Settings" wxi-restricted --user wxi-footer @@ -658,18 +663,18 @@ wxi-ssh-config(){ wxi-ssh-keys(){ case ${args['3']} in generate) - wxi-ssh-keys-retrieve - wxi-ssh-keys-generate - wxi-ssh-keys-save + wxi-ssh-keys-retrieve ${args['4']} + wxi-ssh-keys-generate ${args['4']} + wxi-ssh-keys-save ${args['4']} ;; sign) wxi-ssh-keys-sign ;; retrieve) - wxi-ssh-keys-retrieve + wxi-ssh-keys-retrieve ${args['4']} ;; save) - wxi-ssh-keys-save + wxi-ssh-keys-save ${args['4']} ;; sync) wxi-ssh-keys-sync @@ -747,11 +752,11 @@ wxi-ssh-keys-clean(){ rm "$HOME/.ssh/keys/$1.sig" &> /dev/null fi else - wx-ssh-keys-clean $ORG + wxi-ssh-keys-clean $ORG if [[ $USERNAME == "cwchristerw" ]] then - wx-ssh-keys-clean warengroup + wxi-ssh-keys-clean warengroup fi for file in ~/.ssh/keys/* @@ -818,11 +823,11 @@ wxi-ssh-keys-sign(){ wxi-header "SSH / Keys / Sign" wxi-restricted - wx-ssh-keys-sign-create $ORG sysadmin 3600 + wxi-ssh-keys-sign-create $ORG sysadmin 3600 if [[ $USERNAME == "cwchristerw" ]] then - wx-ssh-keys-sign-create warengroup sysadmin 3600 + wxi-ssh-keys-sign-create warengroup sysadmin 3600 fi wxi-footer } @@ -850,8 +855,8 @@ wxi-ssh-keys-sync(){ then for name in $(curl https://$VAULT_DOMAIN/v1/cli/metadata/$USERNAME/settings/ssh/keys -X LIST --header "X-Vault-Token: $VAULT_TOKEN" -s | jq -r '.data.keys | @sh' | tr -d \') do - echo $name - wx-ssh-keys-retrieve $name --multiple + wxi-content text $name + wxi-ssh-keys-retrieve $name --multiple done fi wxi-footer