You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
653 B

#!/bin/bash
# Author: Tealk
# Repo: https://codeberg.org/Tealk/shell-administration-script
# shellcheck disable=SC2034
title="Set permissions"
printf " %b %s..." "${INFO}" "${title}"
if ! [ "$1" = "chownonly" ]; then
if ! find "${FULLPATH}"/ -type d -exec chmod 755 {} \; >/dev/null 2>&1; then
reason="can't set file permissions"
ERROR
fi
if ! find "${FULLPATH}"/ -type f -exec chmod 644 {} \; >/dev/null 2>&1; then
reason="can't set folder permissions"
ERROR
fi
fi
if ! chown -R "${WEBUSER}":"${WEBGROUP}" "${FULLPATH}"/ >/dev/null 2>&1; then
reason="can't set owner"
ERROR
fi
printf "%b %b %s\\n" "${OVER}" "${TICK}" "${title}"