scripts reorganize

This commit is contained in:
djaidjai committed 2026-10-06 22:34:05 +02:00
1 parent a2a056a68d
commit 0734bee219
60 files changed
+824 -5

No files matched your search

+42
View File
@@ -0,0 +1,42 @@
#!/bin/bash
on_exit() {
(ccrypt -K "$now" -d "$file.cpt")
# prepare regex pattern
shopt -s extglob
readarray -t removeArray < <(grep -ve '^$\|^#' "$file")
IFS='|' eval 'PATTERN="(${removeArray[*]})"'
PATTERN="(^|[^a-zA-Z])$PATTERN([^a-zA-Z]|$)"
case $shell in
*fish)
printf "sanitizing fish history!\n"
"$(dirname "$0")/sanitize_hist.fish" "$PATTERN" "/home/$(whoami)/.local/share/fish/fish_history"
;;
*bash)
printf "sanitizing bash history!\n"
"$(dirname "$0")/sanitize.sh" "$PATTERN" "/home/$(whoami)/.bash_history" 1
;;
*)
printf "autosanitize has no implementation for %s\n" "$shell"
;;
esac
rm -r ~/.cache/thumbnails/*
rm "$file"
}
trap 'on_exit' EXIT
now=$(date +%s.%N)
folder=/run/media/$(whoami)/P/Scripts
file=/tmp/tags
shell=$(grep "$(whoami)" < /etc/passwd | awk -F':' '{print $NF}' )
echo "copying tags to temp file..."
cat "$folder/tags2" "$folder/tags" > "$file"
(sed -i '/^$/d;/^\#.*$/d' "$file")
(ccrypt -K "$now" "$file")
while :; do
sleep 600
done
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.