chmod: replace ~ with $HOME

This commit is contained in:
Aminda Suomalainen 2024-08-15 09:24:38 +03:00
parent dde96cbc53
commit 4443316c63
Signed by: Mikaela
SSH Key Fingerprint: SHA256:CXLULpqNBdUKB6E6fLA1b/4SzG0HvKD19PbIePU175Q

40
chmod
View File

@ -7,44 +7,44 @@ set -x
# You don't want to make this verbose. # You don't want to make this verbose.
chmod g-rwx,o-rwx "$HOME" -R chmod g-rwx,o-rwx "$HOME" -R
touch ~/.oidentd.conf touch $HOME/.oidentd.conf
chmod -v u+rw,g-wx+r,o-wx+r ~/.oidentd.conf chmod -v u+rw,g-wx+r,o-wx+r $HOME/.oidentd.conf
touch ~/.ICEauthority touch $HOME/.ICEauthority
chmod -v o-rw+x,g-rw+x ~ chmod -v o-rw+x,g-rw+x $HOME
mkdir -p ~/public_html/ mkdir -p $HOME/public_html/
chmod -v -R 755 ~/public_html/ chmod -v -R 755 $HOME/public_html/
touch ~/.face touch $HOME/.face
touch ~/.forward touch $HOME/.forward
touch ~/.netrc touch $HOME/.netrc
chmod -v a+r-wx,u+rw ~/.face chmod -v a+r-wx,u+rw $HOME/.face
chmod -v a+r-wx,u+rw ~/.forward chmod -v a+r-wx,u+rw $HOME/.forward
chmod -v 600 ~/.netrc chmod -v 600 $HOME/.netrc
mkdir -p ~/.ssh mkdir -p $HOME/.ssh
chmod -v 700 ~/.ssh chmod -v 700 $HOME/.ssh
touch ~/.ssh/authorized_keys touch $HOME/.ssh/authorized_keys
chmod -v 600 ~/.ssh/authorized_keys chmod -v 600 $HOME/.ssh/authorized_keys
mkdir -p "$HOME/AppImages" mkdir -p "$HOME/AppImages"
chmod a+rx "$HOME/AppImages/" "$HOME/AppImages/*.appimage" chmod a+rx "$HOME/AppImages/" "$HOME/AppImages/*.appimage"
# if we have support for setting ACL, some of this becomes easier (although maybe redundant) # if we have support for setting ACL, some of this becomes easier (although maybe redundant)
if hash setfacl 2> /dev/null; then if hash setfacl 2> /dev/null; then
setfacl --modify u:$(id -un):rw,g:$(id -gn):r,o:r ~/.oidentd.conf setfacl --modify u:$(id -un):rw,g:$(id -gn):r,o:r $HOME/.oidentd.conf
setfacl --modify=u:$(id -un):rwX,g:$(id -gn):rX,o:rX "$HOME/AppImages/" setfacl --modify=u:$(id -un):rwX,g:$(id -gn):rX,o:rX "$HOME/AppImages/"
setfacl --recursive --modify u:$(id -un):rwX,g:$(id -gn):rX,o:rX ~/public_html/ setfacl --recursive --modify u:$(id -un):rwX,g:$(id -gn):rX,o:rX $HOME/public_html/
for appimage in $(find $HOME/AppImages/*.appimage); do for appimage in $(find $HOME/AppImages/*.appimage); do
setfacl --modify=u:$(id -un):rwX,g:$(id -gn):rX,o:rX $appimage setfacl --modify=u:$(id -un):rwX,g:$(id -gn):rX,o:rX $appimage
done done
# Enabling laziness pt. … # Enabling laziness pt. …
if [[ -d ~/.shell-things ]]; then if [[ -d $HOME/.shell-things ]]; then
setfacl --recursive --modify u:$(id -un):rwX,g:$(id -gn):rX,o:rX ~/.shell-things/ setfacl --recursive --modify u:$(id -un):rwX,g:$(id -gn):rX,o:rX $HOME/.shell-things/
fi fi
fi fi