Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/kasper9n/my-bash-scripts. My personal bash scripts
Something went wrong. Try again.
522 B · 21 lines
at master
12345678910111213141516171819202122#! /bin/bash
help() { echo "Resets permissions of a directory. Make sure you know what you're doing first." echo "" echo "These are the commands it runs:" echo `color 3 'sudo chmod -RN <DIRECTORY> && sudo chown -R <USERNAME> <DIRECTORY> && sudo chmod -R 755 <DIRECTORY>'` echo "" echo "`color 2 Usage:` reset-permissions <username> <directory>" echo ""}
if [[ "$2" == '' ]]; then helpelse
USERNAME=$1 DIR=$2 sudo chmod -RN "${DIR}" && sudo chown -R ${USERNAME} "${DIR}" && sudo chmod -R 755 "${DIR}"
fi