From 9496eb520db9d6a16f408e9065625ea5c6016c67 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Tue, 3 May 2022 18:26:15 +0200 Subject: [PATCH] bin: documentation fixes --- .config/shell/server | 9 +++++++-- .local/bin/scripts/git-fork | 2 +- .local/bin/scripts/git-get | 3 +-- .local/bin/scripts/help | 2 +- .local/bin/scripts/rd | 1 + 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.config/shell/server b/.config/shell/server index e3758a0..530d5b1 100644 --- a/.config/shell/server +++ b/.config/shell/server @@ -19,7 +19,9 @@ stack() { ;; (sso) shift builtin cd "$STACKSPIN" - kubectl exec -n stackspin $(kubectl get pods -A | grep single-sign-on-login | awk '{print $2}') -- flask "$@";; + -- flask "$@";; + kubectl exec -n stackspin-apps nc-nextcloud-56bc649d78-q7snw -it -- su www-data -s /bin/bash -c "php occ fi +les:scan --all" (user) if test "$2" = "init" then mail="$3" @@ -27,8 +29,11 @@ stack() { stack user create "$mail" stack user update "$mail" name "$*" echo "Initialized user '$*' with email '$mail'" - else kubectl exec -n stackspin $(kubectl get pods -A | grep single-sign-on-login | awk '{print $2}') -- flask "$@" + else "$0" pod single-sign-on -- flask "$@" fi;; + (pod) shift + kubectl exec -n stackspin \ + $(kubectl get pods -A | grep "$1-" | awk '{print $2}');; (*) builtin cd "$STACKSPIN" if test $# -gt 1 -a "$1" = install then shift && "./install/install-$1.sh" || ./install/install-app.sh "$@" diff --git a/.local/bin/scripts/git-fork b/.local/bin/scripts/git-fork index 8ee3192..3577fb3 100755 --- a/.local/bin/scripts/git-fork +++ b/.local/bin/scripts/git-fork @@ -4,7 +4,7 @@ # - repo name (omit if setting upstream in existing repo) # - upstream user # - own user -# - url +# - host # - target directory name (and further arguments to clone) # In an existing repo, first arg is omitted test $# -eq 0 && echo "Usage: $0 [repo] [upstream owner] [own user] [url]" && exit 2 diff --git a/.local/bin/scripts/git-get b/.local/bin/scripts/git-get index 21070e6..4c38809 100755 --- a/.local/bin/scripts/git-get +++ b/.local/bin/scripts/git-get @@ -1,7 +1,6 @@ -#!/bin/sh +#!/bin/sh -e # Clones from resolving the arguments and switches into the new directory # ARGS see git-repo -set -e remote=$(git-repo "$@") echo "Cloning $remote" git clone $remote ${@:4} --recurse-submodules diff --git a/.local/bin/scripts/help b/.local/bin/scripts/help index 33386fe..04498d7 100755 --- a/.local/bin/scripts/help +++ b/.local/bin/scripts/help @@ -10,7 +10,7 @@ case $1 in # need to install zsh-doc package for info pages info --vi-keys $(test "$last" != zsh && echo "--index-search=$last") zsh || LESS="$LESS +/^ *$last *\\[" man zshall;; - (gh|chordpro|bat|pdfjam|reflector|topgrade|r128gain|7z) unbuffer "$@" --help | $paginate;; + (gh|chordpro|bat|pdfjam|reflector|topgrade|r128gain|7z|kubectl) unbuffer "$@" --help | $paginate;; (caddy|stretchly|go) "$1" help "${@:2}" | $paginate;; (rails) { rails -H && rails --help; } | $paginate;; (plantuml) unbuffer "$@" -help | $paginate;; diff --git a/.local/bin/scripts/rd b/.local/bin/scripts/rd index cad4375..ce89e80 100755 --- a/.local/bin/scripts/rd +++ b/.local/bin/scripts/rd @@ -14,6 +14,7 @@ do exit fi + $elevate find "$f" -maxdepth $(expr 1 \& "$f" = "/" \| 5 \& $# \> 0 \| 4) -type d -empty -name .stfolder -exec rm -div {} \; $elevate find "$f" -maxdepth $(expr 1 \& "$f" = "/" \| 5 \& $# \> 0 \| 3) -not -name .stfolder \( -type d -o -type f \) -a -empty -printf 'Removing empty %p\n' -delete test $# -eq 0 && exit $? if test -e "$f"; then