A simple script to restart the DHCP server?

Jonathan Marsden jmarsden at fastmail.fm
Wed Sep 19 02:36:46 UTC 2012


On 09/18/2012 03:18 PM, John Hupp wrote:

> I tried creating myscript.sh thus:
>     #!/bin/bash
>     sudo service isc-dhcp-server restart
> 
> Then I ran "sudo chmod a+x myscript.sh" to make it executable by all.
> 
> But when I run the script choosing either Execute or Execute in
> Terminal, I get no prompt for a password and it seems that the service
> restart command has not run.

Try using gksudo instead of sudo, so you get a GUI prompt for the password.

  #!/bin/bash
  gksudo service isc-dhcp-server restart

Jonathan





More information about the Lubuntu-users mailing list