Skip to content

Commit ada291a

Browse files
committed
Fixed a few typos that rendered init system unresponsive.
1 parent 34a00bd commit ada291a

File tree

4 files changed

+86
-3
lines changed

4 files changed

+86
-3
lines changed

net-services/ipv4-static

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#!/bin/sh
2+
########################################################################
3+
# Begin /lib/services/ipv4-static
4+
#
5+
# Description : IPV4 Static Boot Script
6+
#
7+
# Authors : Nathan Coulson - [email protected]
8+
# Kevin P. Fleming - [email protected]
9+
# Update : Bruce Dubbs - [email protected]
10+
#
11+
# Version : LFS 7.0
12+
#
13+
########################################################################
14+
15+
#. /lib/lsb/init-functions
16+
. ${IFCONFIG}
17+
18+
if [ -z "${IP}" ]; then
19+
echo "IP variable missing from ${IFCONFIG}, cannot continue."
20+
exit 1
21+
fi
22+
23+
if [ -z "${PREFIX}" -a -z "${PEER}" ]; then
24+
echo "PREFIX variable missing from ${IFCONFIG}, assuming 24."
25+
PREFIX=24
26+
args="${args} ${IP}/${PREFIX}"
27+
28+
elif [ -n "${PREFIX}" -a -n "${PEER}" ]; then
29+
echo "PREFIX and PEER both specified in ${IFCONFIG}, cannot continue."
30+
exit 1
31+
32+
elif [ -n "${PREFIX}" ]; then
33+
args="${args} ${IP}/${PREFIX}"
34+
35+
elif [ -n "${PEER}" ]; then
36+
args="${args} ${IP} peer ${PEER}"
37+
fi
38+
39+
if [ -n "${BROADCAST}" ]; then
40+
args="${args} broadcast ${BROADCAST}"
41+
fi
42+
43+
case "${2}" in
44+
up)
45+
if [ "$(ip addr show ${1} 2>/dev/null | grep ${IP}/)" = "" ]; then
46+
47+
# Cosmetic output not needed for multiple services
48+
#if ! $(echo ${SERVICE} | grep -q " "); then
49+
# echo "" # Terminate the previous message
50+
#fi
51+
52+
echo "Adding IPv4 address ${IP} to the ${1} interface..."
53+
ip addr add ${args} dev ${1}
54+
#evaluate_retval
55+
else
56+
echo "Cannot add IPv4 address ${IP} to ${1}. Already present."
57+
fi
58+
;;
59+
60+
down)
61+
if [ "$(ip addr show ${1} 2>/dev/null | grep ${IP}/)" != "" ]; then
62+
echo "Removing IPv4 address ${IP} from the ${1} interface..."
63+
ip addr del ${args} dev ${1}
64+
#evaluate_retval
65+
fi
66+
67+
if [ -n "${GATEWAY}" ]; then
68+
# Only remove the gateway if there are no remaining ipv4 addresses
69+
if [ "$(ip addr show ${1} 2>/dev/null | grep 'inet ')" != "" ]; then
70+
echo "Removing default gateway..."
71+
ip route del default
72+
#evaluate_retval
73+
fi
74+
fi
75+
;;
76+
77+
*)
78+
echo "Usage: ${0} [interface] {up|down}"
79+
exit 1
80+
;;
81+
esac
82+
83+
# End /lib/services/ipv4-static
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/execlineb -P
22

3-
foreground { "/etc/s6-rc/stage2.tini" }
3+
foreground { "/etc/s6/stage2.tini" }
44
s6-svscanctl -t -- "/run/boot"/service

s6/run-image/service/.s6-svscan/finish

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ fdmove -c 1 2
66
foreground { s6-svc -X -- /run/boot/service/s6-svscan-log }
77
unexport ?
88
wait -r -- { }
9-
/etc/s6-rc/stage3 ${@}
9+
/etc/s6/stage3 ${@}

s6/stage2

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/execlineb -P
22
# stage2
33

4-
s6-envdir -if /etc/s6-rc/env
4+
s6-envdir -if /etc/s6/env
55

66
foreground {
77
if { s6-echo -- "\n[ Stage 2 ] Loading ...\n" }

0 commit comments

Comments
 (0)