v-delete-wordpress-uploads-php-files: set default response to 'yes' for moving files to quarantine

This commit is contained in:
Peca 2025-07-16 13:57:37 +02:00
commit 3801e8d6cf

View file

@ -38,9 +38,8 @@ echo "-------------------------------------"
echo "$files" echo "$files"
echo "-------------------------------------" echo "-------------------------------------"
while true; do read -r -p "Do you want to move these files to quarantine? (y/n, default: y): " RESPONSE < /dev/tty
read -r -p "Do you want to delete these files? (y/n): " RESPONSE < /dev/tty if [ "$RESPONSE" == "y" ] || [ "$RESPONSE" == "Y" ] || [ -z "$RESPONSE" ]; then
if [ "$RESPONSE" == "y" ] || [ "$RESPONSE" == "Y" ]; then
for file in $files; do for file in $files; do
source_file="/home/$USER/web/$DOMAIN/public_html/$file" source_file="/home/$USER/web/$DOMAIN/public_html/$file"
destination_file="/srv/wp-uploads-php-files-quarantine/$DOMAIN/$file" destination_file="/srv/wp-uploads-php-files-quarantine/$DOMAIN/$file"
@ -52,12 +51,7 @@ while true; do
quarantined=1; quarantined=1;
done done
chown -R $USER:$USER "/srv/wp-uploads-php-files-quarantine/$DOMAIN" chown -R $USER:$USER "/srv/wp-uploads-php-files-quarantine/$DOMAIN"
break; fi
fi
if [ "$RESPONSE" == "n" ] || [ "$RESPONSE" == "N" ]; then
break;
fi
done
echo "" echo ""
if [ $quarantined -eq 1 ]; then if [ $quarantined -eq 1 ]; then