diff options
author | Ismael Luceno | 2021-05-30 15:01:31 +0200 |
---|---|---|
committer | Ismael Luceno | 2021-05-30 15:02:44 +0200 |
commit | 30340fd0e589396e04753ad95c79a2838bb3edc9 (patch) | |
tree | 10cdd3921f7e42f362b69f3934a24998543bfa8b /net | |
parent | b6dd113ce7288f7a7a73ad7e40093f7eab061806 (diff) |
ifupdown-ng: new spell, flexible ifup/ifdown implementation
Diffstat (limited to 'net')
-rwxr-xr-x | net/ifupdown-ng/BUILD | 1 | ||||
-rwxr-xr-x | net/ifupdown-ng/CONFLICTS | 2 | ||||
-rwxr-xr-x | net/ifupdown-ng/DEPENDS | 3 | ||||
-rwxr-xr-x | net/ifupdown-ng/DETAILS | 15 | ||||
-rw-r--r-- | net/ifupdown-ng/HISTORY | 3 | ||||
-rwxr-xr-x | net/ifupdown-ng/INSTALL | 4 | ||||
-rwxr-xr-x | net/ifupdown-ng/init.d/mountnetwork | 43 | ||||
-rw-r--r-- | net/ifupdown-ng/init.d/mountnetwork.conf | 4 | ||||
-rwxr-xr-x | net/ifupdown-ng/init.d/network | 49 |
9 files changed, 124 insertions, 0 deletions
diff --git a/net/ifupdown-ng/BUILD b/net/ifupdown-ng/BUILD new file mode 100755 index 0000000000..6dfecc1f8a --- /dev/null +++ b/net/ifupdown-ng/BUILD @@ -0,0 +1 @@ +default_build_make diff --git a/net/ifupdown-ng/CONFLICTS b/net/ifupdown-ng/CONFLICTS new file mode 100755 index 0000000000..8e0675ecce --- /dev/null +++ b/net/ifupdown-ng/CONFLICTS @@ -0,0 +1,2 @@ +conflicts ifupdown && +conflicts ifupdown-wpa diff --git a/net/ifupdown-ng/DEPENDS b/net/ifupdown-ng/DEPENDS new file mode 100755 index 0000000000..0bc8025908 --- /dev/null +++ b/net/ifupdown-ng/DEPENDS @@ -0,0 +1,3 @@ +depends iproute2 && +optional_depends dhcpcd '' '' 'for DHCP support' && +optional_depends wpa_supplicant '' '' 'for 802.11i (WPA/2/3) support' diff --git a/net/ifupdown-ng/DETAILS b/net/ifupdown-ng/DETAILS new file mode 100755 index 0000000000..055ee7dd1c --- /dev/null +++ b/net/ifupdown-ng/DETAILS @@ -0,0 +1,15 @@ + SPELL=ifupdown-ng + VERSION=0.11.2 + SOURCE="$SPELL-$VERSION.tar.gz" + SOURCE_URL[0]=https://github.com/$SPELL/$SPELL/archive/refs/tags/$SOURCE + SOURCE_HASH=sha512:a10e8aba67082c6fadf64925d6477aae6794f8b989cdabf47f2369ac1accc645e953436ed74c8d06f2ae37ab86746c9c6614aea1c163ad040ada1dbc0dc8ed95 +SOURCE_DIRECTORY="$BUILD_DIRECTORY/$SPELL-$SPELL-$VERSION" + WEB_SITE="https://github.com/ifupdown-ng/ifupdown-ng" + LICENSE[0]="ISC" + ENTERED=20210524 + KEYWORDS="" + SHORT="flexible ifup/ifdown implementation" +cat << EOF +ifupdown-ng is a network device manager that is largely compatible with +Debian ifupdown, BusyBox ifupdown and Cumulus Networks' ifupdown2. +EOF diff --git a/net/ifupdown-ng/HISTORY b/net/ifupdown-ng/HISTORY new file mode 100644 index 0000000000..b34bfd8566 --- /dev/null +++ b/net/ifupdown-ng/HISTORY @@ -0,0 +1,3 @@ +2021-05-30 Ismael Luceno <ismael@sourcemage.org> + * BUILD, CONFLICTS, DEPENDS, DETAILS, INSTALL, init.d/mountnetwork, + init.d/mountnetwork.conf, init.d/network: spell created diff --git a/net/ifupdown-ng/INSTALL b/net/ifupdown-ng/INSTALL new file mode 100755 index 0000000000..f2ec197ce3 --- /dev/null +++ b/net/ifupdown-ng/INSTALL @@ -0,0 +1,4 @@ +default_install && +for i in up down query; do + ln -sf ifupdown /sbin/if"$i" +done diff --git a/net/ifupdown-ng/init.d/mountnetwork b/net/ifupdown-ng/init.d/mountnetwork new file mode 100755 index 0000000000..730529f400 --- /dev/null +++ b/net/ifupdown-ng/init.d/mountnetwork @@ -0,0 +1,43 @@ +#!/bin/bash + +. /etc/sysconfig/mountnetwork + +PROGRAM=/bin/false +RUNLEVEL=3 +NEEDS="+network" +PROVIDES="remote_fs" + +file_system_list="" + +for fs in ${FILESYSTEMS} ; do + if [[ $fs == "nfs" ]] ; then + NEEDS="$NEEDS +portmap" + fi + file_system_list="$file_system_list,$fs" +done +file_system_list=${file_system_list:1} + +. /etc/init.d/smgl_init + +start() +{ + if [ "$file_system_list" != "" ] ; then + required_executable /bin/mount + + echo "Mounting remote filesystems..." + mount -a -F -t $file_system_list + evaluate_retval + fi +} + +stop() +{ + if [ "$file_system_list" != "" ] ; then + required_executable /bin/umount + + echo "Unmounting remote filesystems..." + umount -a -r -t $file_system_list + evaluate_retval + fi +} + diff --git a/net/ifupdown-ng/init.d/mountnetwork.conf b/net/ifupdown-ng/init.d/mountnetwork.conf new file mode 100644 index 0000000000..3211ca4184 --- /dev/null +++ b/net/ifupdown-ng/init.d/mountnetwork.conf @@ -0,0 +1,4 @@ +# A space separated list of network file systems that are to be mounted at +# boot. Supported values are "cifs", "nfs", "ncpfs", "smbfs" and "9p" (without +# the quotes). The /usr hierachy may be loaded through this script. +FILESYSTEMS="cifs nfs ncpfs smbfs 9p" diff --git a/net/ifupdown-ng/init.d/network b/net/ifupdown-ng/init.d/network new file mode 100755 index 0000000000..6424812af2 --- /dev/null +++ b/net/ifupdown-ng/init.d/network @@ -0,0 +1,49 @@ +#!/bin/bash + +PROGRAM=/bin/false # To get auto_init functionality +RUNLEVEL=3 +PROVIDES=network +RECOMMENDED=yes + +[ "$USE_SYSLOG" = "yes" ] && NEEDS="+syslog" + +. /etc/init.d/smgl_init + +required_executable /sbin/ifup +required_executable /sbin/ifdown + +start() +{ + # make sure all the interfaces really do come up + echo "Starting networking..." + /sbin/ifup --force -a + evaluate_retval +} + +stop() +{ + echo "Stopping networking..." + /sbin/ifdown -a + evaluate_retval +} + +restart() +{ + echo "Restarting ALL interfaces" + stop + # sleeping for some trickle time + sleep 3 + start +} + +status() +{ + exit 0 +} + +reload() { exit 3; } + +usage() +{ + echo "Usage: $0 {start|stop|restart|status} [DEVICE]" +} |