From 34cb04dc6d951fbbc3262ebc68c6865e3da55a59 Mon Sep 17 00:00:00 2001 From: Tobias Reisinger Date: Tue, 30 Apr 2024 18:24:24 +0200 Subject: [PATCH] Update scripts --- .bin/ansible-vault-manager | 26 +++++++++++++++----------- .bin/git-retag | 6 +++--- .bin/git-vtag | 3 +++ .bin/portalo-mode | 17 +++++++++++++++++ .bin/telnet-ts | 7 +++++++ 5 files changed, 45 insertions(+), 14 deletions(-) create mode 100755 .bin/git-vtag create mode 100755 .bin/portalo-mode create mode 100755 .bin/telnet-ts diff --git a/.bin/ansible-vault-manager b/.bin/ansible-vault-manager index fbf83b7..3ebe41a 100755 --- a/.bin/ansible-vault-manager +++ b/.bin/ansible-vault-manager @@ -28,23 +28,27 @@ fi pass_content=$(pass "ansible/$project") pass_path=$project_dir/$(echo "$pass_content" | grep "path:" | cut -d' ' -f2-) -case "$1" in +action="${1:-show}" +case "$action" in + show) + echo "$pass_content" | head -n 1 + exit 0 ;; + view) + ansible-vault view "$pass_path" + exit 0 ;; edit) ansible-vault edit "$pass_path" - exit 0 - ;; + exit 0 ;; deploy) pass show "ansible/$project.file" > "$pass_path" - exit 0 - ;; + exit 0 ;; save) pass insert -m "ansible/$project.file" < "$pass_path" - exit 0 - ;; + exit 0 ;; pass-edit) pass edit "ansible/$project" - exit 0 - ;; + exit 0 ;; + *) + echo "Usage: ansible-vault-manager [show|view|edit|deploy|save|pass-edit]" + exit 0 ;; esac - -echo "$pass_content" | head -n 1 diff --git a/.bin/git-retag b/.bin/git-retag index 99d4f2d..6614f93 100755 --- a/.bin/git-retag +++ b/.bin/git-retag @@ -1,10 +1,10 @@ #!/usr/bin/env sh echo "Deleting tag from origin" -git push --delete origin "$1" +git push --delete origin "v$1" echo "Deleting tag locally" -git tag -d "$1" +git tag -d "v$1" echo "Recreating tag" -git tag -s -m "$1" "$1" +git vtag "$1" diff --git a/.bin/git-vtag b/.bin/git-vtag new file mode 100755 index 0000000..a9587cc --- /dev/null +++ b/.bin/git-vtag @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +git tag -sm "v$1" "v$1" diff --git a/.bin/portalo-mode b/.bin/portalo-mode new file mode 100755 index 0000000..0e6afcd --- /dev/null +++ b/.bin/portalo-mode @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +portalo_mode_std () { + echo "Loading portalo standard screen layout" + yadm config --unset-all local.class monitor-single +} + +portalo_mode_single () { + echo "Loading portalo single screen layout" + yadm config --add local.class monitor-single +} + +case $1 in + std) portalo_mode_std ;; + single) portalo_mode_single ;; + *) echo "'$1' is not a valid-setup (single, std)" ;; +esac diff --git a/.bin/telnet-ts b/.bin/telnet-ts new file mode 100755 index 0000000..67c8f20 --- /dev/null +++ b/.bin/telnet-ts @@ -0,0 +1,7 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p inetutils + +echo "auth apikey=$TS3_CLIENT_API_KEY" | wl-copy + +telnet 127.0.0.1 25639 +