Copyright (C) 1998 by Steve Litt, All rights reserved. Material provided as-is, use at your own risk.
| Machine Description | IP
(or note auto) |
Netmask
(or note auto) |
Wins/dhcp? | Identification tab:
computer name |
Identification tab:
workgroup |
DNS tab:
Host, domain, list |
#!/usr/bin/perl -w
my($ip) = "192.168.106.3";
my($netmask) = "255.255.255.0";
my($oldip) = "192.168.105.3";
print "\n\n\n\nSETSERV\n";
#&checkit;
#exit;
system("hostname linuxhost");
system("ifconfig eth0 $ip netmask $netmask");
system("route del -net $ip");
system("route del -net $oldip");
system("route add -net $ip");
system("joe /etc/sysconfig/network");
system("joe /etc/sysconfig/network-scripts/ifcfg-eth0");
system("joe /etc/sysconfig/network-scripts/ifcfg-eth0:0");
system("rm /etc/sysconfig/network-scripts/ifcfg-eth0:0~");
system("joe /etc/resolv.conf");
system("joe /etc/hosts");
system("joe /etc/dhcpd.conf");
system("joe /etc/dhcpd.leases");
system("joe /etc/debug");
system("joe /etc/named.boot");
system("joe /etc/smb.conf");
system("joe /var/named/named.forward");
system("joe /var/named/named.reverse");
system("joe /etc/httpd/conf/httpd.conf");
&checkit;
sub checkit
{
system("find /var/named -type f | xargs grep -l $oldip > junk.named");
system("find /etc -type f | xargs grep -l $oldip >> junk.etc");
system("cat junk.named junk.etc | less");
}
sub restartt
{
system("kill `cat /var/run/httpd.pid`");
system("/etc/rc.d/init.d/httpd start");
system("/etc/rc.d/init.d/named stop");
system("/etc/rc.d/init.d/named start");
system("/etc/rc.d/init.d/network stop");
system("/etc/rc.d/init.d/network start");
system("/etc/rc.d/init.d/sendmail stop");
system("/etc/rc.d/init.d/sendmail start");
}
|
mount /dev/hda6 /mnt cd /mnt/etc/rc.d/rc3.d mv S72amd _S72amd mv S80sendmail _S80sendmail cd / umount /mnt exitNote the following about the above sequence: