Commit 94cfbf38 authored by Cédric Marie's avatar Cédric Marie

Add mychmod[rw/ro] scripts

These scripts chmod recursively directories (775) and files (either 664
(rw) or 444 (ro)), which complies with User Private Group (UPG) scheme.
Signed-off-by: default avatarCédric Marie <cedric@hjuvi.lautre.net>
parent 03f1dc6e
#!/bin/sh
# mychmodro - chmod recursively directories 775 and files 444
# This file is part of Painted Shell - Shell configuration and scripts.
#
# Written in 2019 by Cédric Marie
#
# To the extent possible under law, the author(s) have dedicated all copyright
# and related and neighboring rights to this software to the public domain
# worldwide. This software is distributed without any warranty.
#
# You should have received a copy of the CC0 Public Domain Dedication along
# with this software.
# If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
printf "Current directory: "
pwd
printf "Do you want to chmod 775(directories)/444(files) (y/N)? "
read answer
if [ "$answer" != "y" ]; then
exit 0
fi
printf "Directories...\n"
find -type d -exec chmod 775 {} \;
printf "Files...\n"
find -type f -exec chmod 444 {} \;
printf "Done\n"
#!/bin/sh
# mychmodrw - chmod recursively directories 775 and files 664
# This file is part of Painted Shell - Shell configuration and scripts.
#
# Written in 2019 by Cédric Marie
#
# To the extent possible under law, the author(s) have dedicated all copyright
# and related and neighboring rights to this software to the public domain
# worldwide. This software is distributed without any warranty.
#
# You should have received a copy of the CC0 Public Domain Dedication along
# with this software.
# If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
printf "Current directory: "
pwd
printf "Do you want to chmod 775(directories)/664(files) (y/N)? "
read answer
if [ "$answer" != "y" ]; then
exit 0
fi
printf "Directories...\n"
find -type d -exec chmod 775 {} \;
printf "Files...\n"
find -type f -exec chmod 664 {} \;
printf "Done\n"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment