Created
October 27, 2021 22:27
-
-
Save suuhm/dd924cf91cf46003513cb2fc086bb3bd to your computer and use it in GitHub Desktop.
openwrt dhclient replacement script to renew dhcp addresses - chmod +x ./odhclient.sh && ./odhclient.sh <DEVICE> <MAC>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#eth0.23 - MAC: 9C:80:DF:22:11:11 | |
# | |
# suuhm (c) 2021 | |
# | |
# ./odhclient.sh <DEVICE> <MAC> | |
# | |
echo "Settings up now... Device $1 - MAC $2" | |
udhcpcd -k $1 | |
udhcpcd -n $1 | |
exit 0 | |
ifconfig $1 down | |
ifconfig $1 hw ether $2 | |
ifconfig $1 up | |
sleep 2 | |
ifconfig $1 | |
echo "done" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment