I want to run the following script:
#!/bin/bash if grep -qs 'MinecraftServer' /media/kiancross/MinecraftServer/MinecraftServer; then echo "Disk already mounted, server boot will continue" else mount /dev/sda1 /media/kiancross/MinecraftServer fi sudo mount /dev/sda1 /media/kiancross/MinecraftServer cd /media/kiancross/MinecraftServer/MinecraftServer/1.6.4 screen -d -m -S MinecraftServer ./start.sh screen -r MinecraftServer
My problem is, is that mount requires sudo and I want people who are not administrators to be able to run this script. When I run the script, it says
mount: only root can do that then it asks me for my administrator password.
I followed instructions on other forums that recommended you go to
then add the following line of code:
myusername ALL = (root) NOPASSWD: /path/to/my/program. After trying this, even with a restart I was still asked to ewnter my password. I also tried changing the owner of the file to
root by following the instructions in this post.
After doing that, I was still unable to run it without a password.
I am running Ubuntu 14.04.