initial
[zsh.git] / .zsh / functions / mcdrom
1 # -*- mode:sh -*-
2
3 local mounted
4 local cpwd
5 mounted=$(grep cdrom /etc/mtab)
6 if [[ $mounted = "" ]];then
7 mount /cdrom/
8 echo "-- mounted cdrom --"
9 cd /cdrom/ ; ls
10 else
11 cpwd=$(pwd|grep cdrom)
12 if [[ $cpwd = "" ]];then
13 umount /cdrom/
14 echo "-- umounted cdrom --"
15 else
16 cd; umount /cdrom/
17 echo "-- umounted cdrom --"
18 pwd
19 fi
20 fi