From 108b061201d2d9fc8c88dfc0637c94002480aff2 Mon Sep 17 00:00:00 2001 From: Robert Date: Thu, 2 Jul 2026 18:21:22 -0400 Subject: [PATCH] Ask user if they want protection On/Off. --- .aliases.d/greetings.sh | 4 +- .aliases.d/welcome.sh | 2 + .bash_aliases | 41 ++++++++++++++++++- .gitignore | 1 + ...allPipeWire.sh => installPipeWireAudio.sh} | 0 5 files changed, 43 insertions(+), 5 deletions(-) rename scripts/{installPipeWire.sh => installPipeWireAudio.sh} (100%) diff --git a/.aliases.d/greetings.sh b/.aliases.d/greetings.sh index 573c145..97ed684 100644 --- a/.aliases.d/greetings.sh +++ b/.aliases.d/greetings.sh @@ -1,8 +1,6 @@ +clear echo -e "Kernel & CPU:" `uname -rp` -# print this months calendar out -#cal - if [ -f ~/greetings.txt ]; then cat ~/greetings.txt fi diff --git a/.aliases.d/welcome.sh b/.aliases.d/welcome.sh index 18fed48..c68fbcf 100644 --- a/.aliases.d/welcome.sh +++ b/.aliases.d/welcome.sh @@ -12,3 +12,5 @@ else echo "You are logged in as an admin becareful! This is a restricted system." echo -ne "\033[0m" fi + +alias month='/usr/bin/ncal -C' diff --git a/.bash_aliases b/.bash_aliases index 19434a3..555c9eb 100755 --- a/.bash_aliases +++ b/.bash_aliases @@ -8,10 +8,47 @@ _f_do_as() { fi } -if [ -f ~/scripts/helper/scan_aliases.sh ]; then +toggle_protection() { + local choice + + mkdir -p ~/.data + + while true; do + echo "Do you want protection ON or OFF?" + echo "Protection will look for changes in the system, if found it will alert you. Its not perfect, but a smiple check." + echo "Note if truning on, please be an SUDOer or tell root what your doing! This is a global setting!" + echo "1) ON" + echo "2) OFF" + read -p "Enter your choice (1 or 2): " choice + + case "$choice" in + 1|on|ON|On|yes|y) + touch ~/.data/protectionON + echo "✓ Protection is now ON" + return 0 + ;; + 2|off|OFF|Off|no|n) + touch ~/.data/protectionOFF + echo "✓ Protection is now OFF" + return 0 + ;; + *) + echo "✗ Invalid choice. Please enter 1 (ON) or 2 (OFF)" + echo "" + ;; + esac + done +} + +if [[ -f ~/scripts/helper/scan_aliases.sh && -f ~/.data/protectionON ]]; then source ~/scripts/helper/scan_aliases.sh else - SANE_TEST_FAILED=0 + if [ -f ~/.data/protectionOFF ]; then + SANE_TEST_FAILED=0 + else + toggle_protection + SANE_TEST_FAILED=0 + fi fi if [ $SANE_TEST_FAILED -eq 0 ]; then diff --git a/.gitignore b/.gitignore index 16f383e..b0a3a3a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .data/*.sum +.data/protection* diff --git a/scripts/installPipeWire.sh b/scripts/installPipeWireAudio.sh similarity index 100% rename from scripts/installPipeWire.sh rename to scripts/installPipeWireAudio.sh