First completed version.

This commit is contained in:
2017-05-05 11:10:41 -05:00
parent 33aa5fb763
commit be8bb6e1d0
7 changed files with 79 additions and 45 deletions

15
SRC/iftools/Makefile Normal file
View File

@@ -0,0 +1,15 @@
dirs:
install -d -v -m 755 $(DESTDIR)/etc/init.d
install -d -v -m 755 $(DESTDIR)/etc/network.d
install -d -v -m 755 $(DESTDIR)/usr/share/iftools
install -d -v -m 755 $(DESTDIR)/usr/share/man/man{5,8}
files:
install -v -m 755 network.init $(DESTDIR)/etc/init.d/network
install -v -m 755 network.conf \
$(DESTDIR)/usr/share/iftools/network.conf
install -v -m 644 network.conf.5 \
$(DESTDIR)/usr/share/man/man5/network.conf.5
install -v -m 644 ifup.8 $(DESTDIR)/usr/share/man/man8/ifup.8
install: dirs files

16
SRC/iftools/network.conf Normal file
View File

@@ -0,0 +1,16 @@
auto lo
iface lo inet loopback
# An example of an interface automatically started on boot with dhcp
#auto eth0
#iface eth0 inet dhcp
# Another example with a static IP and static route
#iface eth1 inet static
# address 192.168.0.202
# netmask 255.255.255.0
# gateway 192.168.0.1
# route 192.168.3.0 via 192.168.0.100
# This requests that all files in /etc/network.d be appended
source-directory network.d

37
SRC/iftools/network.init Executable file
View File

@@ -0,0 +1,37 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: $network
# Required-Start: $local_fs swap localnet
# Required-Stop: $local_fs swap localnet
# Should-Start: $syslog
# Should-Stop: $syslog
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Short-Description: Starts and configures network interfaces.
# Description: Starts and configures network interfaces.
### END INIT INFO
. /lib/lsb/init-functions
case "$1" in
start)
log_info_msg "Bringing up network interfaces"
ifup -a && log_success_msg || log_failure_msg
;;
stop)
log_info_msg "Bringing down network interfaces"
ifdown -a && log_success_msg || log_failure_msg
;;
reload|restart)
log_info_msg "Restarting network interfaced"
ifreload -a && log_success_msg || log_failure_msg
;;
*)
echo "Usage: $0 [start|stop|reload|restart]"
exit 1
;;
esac
exit 0