vi /etc/rc.local, 然後加上這段script
- #!/bin/sh
- if [ “$(ping -c 3 192.168.0.179 | grep ‘0 received’)” ]
- then
- : ; exit 1
- else
- if df | grep -q ‘192.168.0.179:/nfshare’
- then :
- else
- mount -t nfs 192.168.0.179:/nfshare /volume1/local rw,hard,intr,uid=root
- fi
- fi