From 0b84baae26a1858d56c502eb20d2c6b6951a1f0b Mon Sep 17 00:00:00 2001 From: Mikaela Suomalainen Date: Wed, 16 Jul 2014 13:09:59 +0300 Subject: [PATCH] chmod: following fixes * Be verbose * fix command nesting * chmod ~/public_html to 755 (for php) * create netrc and set permissions to 600 --- chmod | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/chmod b/chmod index b87f8d03..aefd01cb 100755 --- a/chmod +++ b/chmod @@ -4,12 +4,13 @@ # access. ## THIS SCRIPT HAS MOVED TO SHELL-THINGS AS "chmod"! ## https://raw.github.com/Mkaysi/shell-things/master/chmod +set -x -GROUP=`id -gn` +GROUP=$(id -gn) -wwwdata=`head -n1 wwwuser` +wwwdata=$(head -n1 wwwuser) -setfacl=`locate setfacl|grep bin|head -n1` +setfacl=$(locate setfacl|grep bin|head -n1) chmod g-rwx,o-rwx $HOME -R @@ -21,13 +22,15 @@ touch ~/.ICEauthority chmod o-rw+x,g-rw+x ~ mkdir -p ~/public_html/ -chmod o+rx-w,g+rxw ~/public_html/ -R +chmod -R 755 ~/public_html/ touch ~/.face touch ~/.forward +touch ~/.netrc echo "" chmod a+r-wx,u+rw ~/.face chmod a+r-wx,u+rw ~/.forward +chmod 600 ~/.netrc if [[ -f $setfacl ]]; then setfacl -R -m u:$wwwdata:rwx ~/public_html