Skip to content

Instantly share code, notes, and snippets.

@suuhm
Created October 27, 2021 22:27
Show Gist options
  • Save suuhm/dd924cf91cf46003513cb2fc086bb3bd to your computer and use it in GitHub Desktop.
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>
#!/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