Bernard,

your change will:
- discard any existing entries and put in only the OSCAR interface. Adding an
entry (and check whether this is necessary at all) would make more sense.
- overwrite the /etc/sysconfig/dhcpd.oscarbak file each time this is invoked,
erasing your backup.

Could you please try improving it a bit, such that we don't run into these
issues later?

Thanks,
Erich


On Friday 02 June 2006 08:57, [EMAIL PROTECTED] wrote:
> Author: bli
> Date: 2006-06-02 02:57:21 -0400 (Fri, 02 Jun 2006)
> New Revision: 4948
> 
> Modified:
>    trunk/lib/OSCAR/MAC.pm
> Log:
> On SUSE Linux, need to setup /etc/sysconfig/dhcpd with the default interface 
> before dhcpd can be (re)started.
> 
> 
> Modified: trunk/lib/OSCAR/MAC.pm
> ===================================================================
> --- trunk/lib/OSCAR/MAC.pm    2006-06-01 19:17:35 UTC (rev 4947)
> +++ trunk/lib/OSCAR/MAC.pm    2006-06-02 06:57:21 UTC (rev 4948)
> @@ -372,6 +372,19 @@
>          open(OUT,">$dhcpd_leases") or (carp "Couldn't create dhcpd.leases 
> files", return undef);
>          close(OUT);
>      }
> +
> +    # Need to setup /etc/sysconfig/dhcpd on SUSE Linux prior to restarting 
> dhcpd
> +    if ($os->{'distro'} eq "suse") {
> +        my $dhcpd_file = "/etc/sysconfig/dhcpd";
> +        run_cmd("/bin/mv -f $dhcpd_file $dhcpd_file.oscarbak");
> +
> +        $cmd = "sed -e 
> 's/^DHCPD_INTERFACE=\".*\"/DHCPD_INTERFACE=\"$interface\"/g' 
> $dhcpd_file.oscarbak > $dhcpd_file";     
> +        if (system($cmd)) {
> +            carp("Failed to update $dhcpd_file");
> +            return 1;
> +        }
> +    }
> +
>      oscar_log_subsection("Step $step_number: Restarting dhcpd service");
>      !system("/etc/init.d/dhcpd restart") or (carp "Couldn't restart dhcpd", 
>                                           return undef);



_______________________________________________
Oscar-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oscar-devel

Reply via email to