Files
syno_scripts/mounted.sh
2018-03-13 08:04:28 +01:00

62 lines
1.9 KiB
Bash
Executable File

#!/bin/bash
#Montage des volumes Films, Series, Videos sur Mac mini
#
FILMSMOUNTPOINT="/Volumes/Films"
SERIESMOUNTPOINT="/Volumes/Series"
VIDEOMOUNTPOINT="/Volumes/Video"
JOUR=$(date +"%Y-%m-%d %T")
#/System/Library/CoreServices/Dock.app/Contents/Resources/finder.png
if mount | grep "on $VIDEOMOUNTPOINT" > /dev/null; then
echo "Video already mounted"
#exit
else
#echo "not mounted"
#mount n'ouvre pas de fenêtre
mkdir $VIDEOMOUNTPOINT
#/sbin/mount -t afp 'afp://admin:LZBrtgcA7bRBDj3M@192.168.0.8/Video' $VIDEOMOUNTPOINT
mount_afp afp://admin:LZBrtgcA7bRBDj3M@192.168.0.8/Video $VIDEOMOUNTPOINT
#monte=$(mount_afp afp://admin:LZBrtgcA7bRBDj3M@192.168.0.8/Video $VIDEOMOUNTPOINT)
retval=$?
if [ $retval = 0 ]; then
#if [ "$monte" = 0 ]; then
osascript -e 'display notification "'"$JOUR"' Le volume Video a été monté" with title "Mounted.sh" subtitle "VIDEOMOUNTPOINT" sound name "Glass"'
fi
retval=3
#open ouvre une fenêtre
#open afp://admin:LZBrtgcA7bRBDj3M@192.168.0.8/Video
#liste des partages AFP disponibles
#dns-sd -B _afpovertcp._tcp
fi
if mount | grep "on $SERIESMOUNTPOINT" > /dev/null; then
echo "Series already mounted"
#exit
else
mkdir $SERIESMOUNTPOINT
mount_afp afp://admin:LZBrtgcA7bRBDj3M@192.168.0.8/Series $SERIESMOUNTPOINT
retval=$?
if [ $retval = 0 ]; then
osascript -e 'display notification "'"$JOUR"' Le volume Series a été monté" with title "Mounted.sh" subtitle "SERIESMOUNTPOINT" sound name "Glass"'
fi
retval=3
fi
if mount | grep "on $FILMSMOUNTPOINT" > /dev/null; then
echo "Films already mounted"
#exit
else
mkdir $FILMSMOUNTPOINT
mount_afp afp://admin:LZBrtgcA7bRBDj3M@192.168.0.8/Films $FILMSMOUNTPOINT
retval=$?
if [ $retval = 0 ]; then
osascript -e 'display notification "'"$JOUR"' Le volume Films a été monté" with title "Mounted.sh" subtitle "FILMSMOUNTPOINT" sound name "Glass"'
fi
retval=3
fi