Skip to content

Commit

Permalink
mxnetctl: Remove "upgrade" command
Browse files Browse the repository at this point in the history
Remove upgrade function, because we'll never need it again.
  • Loading branch information
donald committed Jun 20, 2023
1 parent e57c56b commit a9c03aa
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions mxnetctl/mxnetctl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ sub USAGE {
usage: $0
start [options]
stop [options] # (ignored)
upgrade # switch from eth to net
options:
--quiet : do not log actions
Expand Down Expand Up @@ -193,40 +192,6 @@ sub start {
}
}



sub upgrade {
umask 022;

-d '/etc/local' or mkdir '/etc/local' or die "/etc/local: $!\n";

read_mxnet();
for my $dev (grep /^(eth|net)(\d+)/,network_hardware_devices()) {
my $hw=get_hw_address($dev);
my $new_dev=preferred_device_name($dev,$hw);
}
write_mxnet();

unlink "/etc/udev/rules.d/70-persistent-net.rules";

my $data=slurpfile('/etc/systemd/system/network.service');
unless ($data=~/mxnetctl/) {
$data=~s#^ExecStart#ExecStart=/usr/sbin/mxnetctl start\nExecStart#m;
$data=~s/eth(\d+)/sprintf 'net%02d',$1/eg;
open my $out,'>','/etc/systemd/system/network.service' or die "/etc/systemd/system/network.service: $!\n";
print $out $data;
close $out;
}

warn "updated /etc/local/mxnet , /etc/systemd/system/network.service , /etc/udev/rules.d/70-persistent-net.rules - reboot to activate\n";
}







GetOptions(OPTIONS) or die USAGE;

@ARGV>=1 or die USAGE;
Expand All @@ -238,9 +203,6 @@ if ($cmd eq 'start') {
start();
} elsif ($cmd eq 'stop') {
;
} elsif ($cmd eq 'upgrade') {
upgrade();
;
} else {
die USAGE;
}
Expand Down

0 comments on commit a9c03aa

Please sign in to comment.