Last active
January 23, 2017 15:36
-
-
Save pixie79/6e8b6c24f3f50e12565ffbc5a34ba5ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eux -o pipefail | |
USBDISK="${NONE:-$1}" | |
if [[ "${USER}" == root ]] | |
then | |
USER="${SUDO_USER}" | |
fi | |
DISK="/media/${USER}/${USBDISK}" | |
echo "Changing Ownership on /media/${USER}/${USBDISK} for user: ${USER}" | |
if [[ -d "${DISK}" ]] | |
then | |
cd "${DISK}" | |
if [[ $(pwd) == ${DISK} ]] | |
then | |
echo "Changing" | |
#chown -R ${USER} "${DISK}" | |
exit | |
else | |
echo "Dont trick me with bad path" | |
exit 2 | |
fi | |
else | |
echo "Disk not found" | |
exit 2 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment