I have a script to mount 2 network drives that work perfectly from the terminal using "sudo sh MntPD". This is the content of the MntPD file:
#!/bin/bash
sudo mount.cifs //10.0.0.2/drobo5n2/VideoMedia /media/plexdata -o vers=2.0,username=USERNAME,password=PASSWORD,noperm
sudo mount.cifs //192.168.12.102/drobo5n2 /media/Drobo5n2 -o vers=2.0,username=USERNAME,password=PASSWORD,noperm
exit 0
I have tried using crontab, systemd and rc.local to have this script run automatically at startup with no success. I have modified startup so that no password is required for the sudo command. How can I get this script to run automatically?
#!/bin/bash
sudo mount.cifs //10.0.0.2/drobo5n2/VideoMedia /media/plexdata -o vers=2.0,username=USERNAME,password=PASSWORD,noperm
sudo mount.cifs //192.168.12.102/drobo5n2 /media/Drobo5n2 -o vers=2.0,username=USERNAME,password=PASSWORD,noperm
exit 0
I have tried using crontab, systemd and rc.local to have this script run automatically at startup with no success. I have modified startup so that no password is required for the sudo command. How can I get this script to run automatically?