This commit is contained in:
Christoph J. Scherr 2024-09-22 12:36:46 +02:00
parent 83c46ea4ee
commit 45fd2e35d5
2 changed files with 18 additions and 0 deletions

9
confirm-important.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
echo "Write 'yes do as i say' to confirm that you REALLY want to do this: $@"
read
if [[ "${REPLY,,}" = "yes do as i say" ]]
then
eval $@
else
echo "aborting"
fi

9
confirm.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
echo "To be executed: $@"
read -p "Confirm (Y/N): " -n 1 -r
case "$REPLY" in
y|Y ) echo "es"; eval $@;;
n|N ) echo "o";;
* ) echo -e "\ninvalid";;
esac