Updated permissionreset
This commit is contained in:
@@ -1,3 +1,14 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
find ./ -type d -exec chmod 775 {} \;
|
|
||||||
find ./ -type f -exec chmod 664 {} \;
|
# 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
|
||||||
Reference in New Issue
Block a user