diff options
| author | Woodpecker CI <emmett1.2miligrams@protonmail.com> | 2025-09-07 05:08:51 +0000 |
|---|---|---|
| committer | Woodpecker CI <emmett1.2miligrams@protonmail.com> | 2025-09-07 05:08:51 +0000 |
| commit | 506ccc457f60a476003144e200b67de5707d93c7 (patch) | |
| tree | 815fc6cefb780c971a0a45e402ecc88ab3e61ce4 /busybox/net-static.run | |
| parent | bcceec4faf39a9a67396555a23c13c498c9ef350 (diff) | |
| download | alicelinux-506ccc457f60a476003144e200b67de5707d93c7.tar.gz alicelinux-506ccc457f60a476003144e200b67de5707d93c7.zip | |
Woodpecker CI c09688749462898ade41f76ed66fe67983a70c4a [SKIP CI]
Diffstat (limited to 'busybox/net-static.run')
| -rwxr-xr-x | busybox/net-static.run | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/busybox/net-static.run b/busybox/net-static.run new file mode 100755 index 00000000..0a43abee --- /dev/null +++ b/busybox/net-static.run @@ -0,0 +1,23 @@ +#!/bin/sh +exec 2>&1 + +[ -f ./conf ] && . ./conf + +# bring interface up +ip link set "${IFACE:-wlan0}" up + +# flush old IPs +ip addr flush dev "${IFACE:-wlan0}" + +# assign static IP +ip addr add "${IP:-192.168.1.22}/${NETMASK:-24}" dev "${IFACE:-wlan0}" + +# set default route +ip route add default via "${GATEWAY:-192.168.1.1}" + +# configure DNS +echo "nameserver ${GATEWAY:-192.168.1.1}" > /etc/resolv.conf +echo "nameserver 8.8.8.8" >> /etc/resolv.conf + +# block forever so runit keeps it "up" +exec sleep infinity |