dubdiff/mount-data

15 lines
389 B
Plaintext
Raw Normal View History

2015-02-15 21:15:48 +01:00
#!/bin/bash
# determine the id of the user who invoked this script
# if sudo was used, the user who invoked sudo
if [ ${SUDO_USER} ]
then
REAL_USER=${SUDO_USER}
else
REAL_USER=${USER}
fi
echo "mounting //localhost_data to /mnt/data with uid:gid ${REAL_USER}:${REAL_USER}"
mount -t cifs //localhost/_data /mnt/data -o uid=${REAL_USER} -o gid=${REAL_USER} -o forceuid -o forcegid