diff --git a/func/main.sh b/func/main.sh index 9a7a0a3b4..e359da8fc 100644 --- a/func/main.sh +++ b/func/main.sh @@ -954,3 +954,15 @@ format_aliases() { aliases=$(echo "$aliases" |tr '\n' ',' |sed -e "s/,$//") fi } + +# Simple chmod wrapper that skips symlink files after glob expand +# Taken from HestiaCP +no_symlink_chmod() { + local filemode=$1; shift; + + for i in "$@"; do + [[ -L ${i} ]] && continue + + chmod "${filemode}" "${i}" + done +}