Created
November 3, 2013 19:35
-
-
Save erikvanoosten/7293883 to your computer and use it in GitHub Desktop.
My version of the script on http://task3.cc/418/how-to-automatically-mount-and-umount-apple-time-capsule-on-linux/
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
TIMECAPSULE_IP="" # e.g. "192.168.1.100" | |
TIMECAPSULE_VOLUME="/Time Capsule" # also try "/Data" | |
export PASSWD='YOURPASSWORDHERE' # No need to escape anything (except "'") | |
MOUNT_POINT="/mnt/timecapsule" # no need to create the directory | |
IS_MOUNTED=`mount 2> /dev/null | grep "$MOUNT_POINT" | cut -d' ' -f3` | |
TIMECAPSULE_PATH="//$TIMECAPSULE_IP$TIMECAPSULE_VOLUME" | |
if [[ "$IS_MOUNTED" ]] ;then | |
umount $MOUNT_POINT | |
rmdir $MOUNT_POINT | |
else | |
CHECK_TIMECAPSULE=`smbclient --no-pass -L "$TIMECAPSULE_IP" 2>&1 > /dev/null | grep -m1 -i apple` | |
if [[ "$CHECK_TIMECAPSULE" =~ "Apple" ]] ;then | |
mkdir "$MOUNT_POINT" | |
mount -t cifs "$TIMECAPSULE_PATH" "$MOUNT_POINT" -o file_mode=0777,dir_mode=0777,sec=ntlm | |
fi | |
fi | |
unset PASSWD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you Erik van Oosten, I just run your program for the linux mint system installed on the PC and it worked straight away. the only problem was that I had to mount on my personal files and not on those of root.
Paul Smeulders