From 20b0483d7f323f5c539a0927b5aa29fa55c7f695 Mon Sep 17 00:00:00 2001 From: Ali Date: Fri, 12 Dec 2025 14:49:59 +0800 Subject: [PATCH] Updated permissionreset --- permissionreset | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/permissionreset b/permissionreset index 8c54bd2..d1c813d 100755 --- a/permissionreset +++ b/permissionreset @@ -1,3 +1,14 @@ #!/bin/bash -find ./ -type d -exec chmod 775 {} \; -find ./ -type f -exec chmod 664 {} \; \ No newline at end of file + +# Prompt the user for confirmation +read -p "Reset permissions for all files (0644) and directories (0755) under the current path? (y/N): " confirm + +# Only proceed if the user answers 'y' or 'Y' +if [[ "$confirm" =~ ^[Yy]$ ]]; then + find ./ -type d -exec chmod 775 {} \; + find ./ -type f -exec chmod 664 {} \; + echo "Permissions have been reset." +else + echo "Operation cancelled." + exit 0 +fi \ No newline at end of file