From 8d6ab690c4fcb265703ae71ad50f2abb32ba3d5d Mon Sep 17 00:00:00 2001 From: Tobias Reisinger Date: Tue, 12 Dec 2023 18:55:32 +0100 Subject: [PATCH] Improve some scripts --- .bin/ansible-vault-manager | 6 +++++- .bin/user-cleaner | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100755 .bin/user-cleaner diff --git a/.bin/ansible-vault-manager b/.bin/ansible-vault-manager index cc619ba..fbf83b7 100755 --- a/.bin/ansible-vault-manager +++ b/.bin/ansible-vault-manager @@ -30,7 +30,7 @@ pass_path=$project_dir/$(echo "$pass_content" | grep "path:" | cut -d' ' -f2-) case "$1" in edit) - pass edit "ansible/$project" + ansible-vault edit "$pass_path" exit 0 ;; deploy) @@ -41,6 +41,10 @@ case "$1" in pass insert -m "ansible/$project.file" < "$pass_path" exit 0 ;; + pass-edit) + pass edit "ansible/$project" + exit 0 + ;; esac echo "$pass_content" | head -n 1 diff --git a/.bin/user-cleaner b/.bin/user-cleaner new file mode 100755 index 0000000..38d35ca --- /dev/null +++ b/.bin/user-cleaner @@ -0,0 +1,6 @@ +#!/usr/bin/env sh + +# clean old logs +log_dir="$HOME/.cache/logs" +[ -d "$log_dir" ] \ + && find "$log_dir" -type f -mtime +7 -delete