Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # lines 283 to 304 of /etc/rc.d/rc.network
- # http://www.pearltrees.com/s243a/rewrite-address-puppylinux/id16440971
- # 29nov by shinobar # 9feb10 do not remove $HWADDRESS.conf
- rewrite_mac_address () {
- cat /etc/NETWORKING 2>/dev/null | grep -q -i 'yes' || return
- INTERFACES=/etc/network-wizard/network/interfaces
- HWADDRESS=$(LANG=C ifconfig eth0 | head -n 1 | tr -s ' ' | cut -d' ' -f5)
- [ "$HWADDRESS" != "" ] || return
- TMPFILE=/tmp/$(basename $0)_conf.tmp
- rm -f "$TMPFILE"
- IFCONFIG=$(ifconfig)
- CONFS=$(find "$INTERFACES" -follow -type f -name '*.conf' -printf "%P ")
- if [ "$CONFS" != "" ]; then
- for F in $CONFS; do
- echo "$IFCONFIG"|grep -q "$(basename $F .conf)" && continue
- [ ! -f "$TMPFILE" ] && \
- grep -q '^[[:blank:]]*STATIC_IP=.*yes' "$INTERFACES/$F" && \
- cp "$INTERFACES/$F" "$TMPFILE"
- #rm -f "$INTERFACES/$F"
- done
- fi
- [ -f "$TMPFILE" ] && mv -f "$TMPFILE" "$INTERFACES/$HWADDRESS.conf" || \
- echo "IS_WIRELESS=''" > "$INTERFACES/$HWADDRESS.conf"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement