first check-in of feisty meow codebase. many things broken still due to recent
[feisty_meow.git] / scripts / system / osx_cd_mounter.sh
1 #!/bin/bash
2
3 # keeps trying to mount the cd on a mac mini to overcome
4 # a new bug in itunes seen as of osx leopard upgrade.
5
6 source $SHELLDIR/core/date_stringer.sh
7
8 mountpoint=/Volumes/mounty_cd
9
10 echo "$(date_stringer): starting cd mounter..."
11
12 while true; do
13   if [ ! -d $mountpoint ]; then
14     mkdir $mountpoint
15   fi
16
17   found_device=$(mount|grep -i cddafs)
18   if [ -z "$found_device" ]; then
19     echo "$(date_stringer): cd not mounted--pausing before attempt..."
20     sleep 7
21     echo "$(date_stringer): cd not mounted--now trying to mount..."
22     mount -t cddafs /dev/disk1 $mountpoint
23   else
24     echo "$(date_stringer): cd already mounted--ignoring it."
25   fi
26   sleep 7
27 done
28
29