mirror of
https://github.com/webmin/webmin.git
synced 2026-06-22 20:20:28 +01:00
This PR adds baseline Alpine Linux support in Webmin with OS detection, APK package and update backend, OpenRC boot integration, ifupdown-style networking support and DHCPD defaults. https://github.com/webmin/webmin/issues/2353
39 lines
754 B
Raku
39 lines
754 B
Raku
# Networking functions for Alpine Linux
|
|
|
|
do 'debian-linux-lib.pl';
|
|
|
|
$network_interfaces_config = '/etc/network/interfaces';
|
|
|
|
# apply_network()
|
|
# Apply the interface and routing settings
|
|
sub apply_network
|
|
{
|
|
if (&has_command("rc-service")) {
|
|
&system_logged("(cd / ; rc-service networking restart) >/dev/null 2>&1");
|
|
}
|
|
elsif (-x "/etc/init.d/networking") {
|
|
&system_logged("(cd / ; /etc/init.d/networking restart) >/dev/null 2>&1");
|
|
}
|
|
else {
|
|
&system_logged("(cd / ; ifdown -a ; ifup -a) >/dev/null 2>&1");
|
|
}
|
|
}
|
|
|
|
sub network_config_files
|
|
{
|
|
return ( "/etc/hostname", "/etc/HOSTNAME", "/etc/mailname",
|
|
$network_interfaces_config );
|
|
}
|
|
|
|
sub supports_bonding
|
|
{
|
|
return &has_command("ifenslave");
|
|
}
|
|
|
|
sub supports_vlans
|
|
{
|
|
return &has_command("vconfig");
|
|
}
|
|
|
|
1;
|