A simple script to restart the DHCP server?

John Hupp lubuntu at prpcompany.com
Tue Sep 18 22:18:48 UTC 2012


Hi, all.

Occasionally the LTSP client connected to my Lubuntu LTSP server won't 
PXE boot.  There is a "No DHCP offers were received" sort of message on 
the client.  I believe this is probably a power management issue that 
crops up sometimes when the server does not quite properly emerge from a 
sleep mode.

On the server, from the command line I can interactively "sudo service 
isc-dhcp-server restart."  But I would like to put that in a script for 
a user who know even less than I do.  It's OK if the user has to enter 
the password to execute the command.

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.

How can I do this?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/lubuntu-users/attachments/20120918/e8fdf95e/attachment.html>


More information about the Lubuntu-users mailing list