智能加载虚拟光驱的shell

#/bin/sh
if df|grep mini2440 >/dev/null;
then
#已经挂载,不做
exit
else
#未挂载,挂载
sudo mount -t iso9660 -o loop,iocharset=utf8 /media/娱乐区/mini2440资料.iso /media/mini2440
fi

核心呢,就是判断mini2440是否出现在df(显示各个分区大小,如果加载了名为mini2440的,则在之中会有mini2440),呵呵~这样就防止重复加载导致无法卸载的情况了。。

Leave a Reply

Your email address will not be published. Required fields are marked *