#!/bin/bash
#########################################
# 
#
#
#########################################
shfile=/mnt/mntNetShare.sh
sed -i '$i sudo bash ${shfile}' /etc/rc.local
sudo mkdir /mnt/route

echo "#!/bin/bash" >> ${shfile}
echo "logfile=/root/mylog.txt" >> ${shfile}
echo "rm -f \${logfile}" >> ${shfile}
echo "echo \"self script run at \"\`date\` >> \${logfile}" >> ${shfile}
echo "sleep 10" >> ${shfile}
echo "sudo mount -t cifs -o \"username=a,password=,vers=1.0\" //192.168.31.1/data /mnt/route >> \${logfile} 2>&1" >>${shfile}
echo "if [ \$? == 0 ];then" >> ${shfile}
echo "	echo \"do it\" >> \${logfile}" >> ${shfile}
echo "else" >> ${shfile}
echo "	echo \"not do it\" >> \${logfile}" >> ${shfile}
echo "fi" >> ${shfile}

chmod 755 ${shfile}
