From 89d9326bc1c652a0bf85bf69e64771d225bb2255 Mon Sep 17 00:00:00 2001 From: klein panic Date: Sun, 29 Sep 2024 03:22:57 -0400 Subject: [PATCH] Automated update --- auto_git_update.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/auto_git_update.sh b/auto_git_update.sh index ae74de5..038f217 100755 --- a/auto_git_update.sh +++ b/auto_git_update.sh @@ -1,5 +1,29 @@ #!/usr/bin/env bash +# Declare the security variable +security_variable=2 # Change this value as needed (0, 1, or 2) + +# Check the value of the security variable +if [ "$security_variable" -eq 0 ]; then + echo "Error: security_variable is set to 0. Exiting the script." + exit 1 +fi + +# If the security variable is 2, continue without any conditions +if [ "$security_variable" -eq 2 ]; then + echo "security_variable is set to 2. Running the script without further checks." + # Continue with the rest of your script +else + # If the security variable is 1, check if today is Friday + DAY_OF_WEEK=$(date +%A) + if [ "$DAY_OF_WEEK" = "Friday" ]; then + echo "Today is Friday. Continuing with the script." + else + echo "Error: Today is not Friday (Today is $DAY_OF_WEEK). Exiting the script." + exit 1 + fi +fi + # Check if required commands are available for cmd in git nmcli msmtp ssh scp gh; do if ! command -v "$cmd" &>/dev/null; then