#! /bin/zsh # # this file: # https://dataswamp.org/~incal/conf/.zsh/net # Ethernet PCI bus port and slot number # enp4s0 = e n p 4 s 0 net=enp4s0 dhc () { local opts=($@) sudo dhclient $opts $net } restart-dhc () { dhc -r dhc } restart-ifs () { sudo ifdown $net sudo ifup $net } restart-networking () { sudo /etc/init.d/networking restart } restart-all () { restart-dhc restart-ifs restart-networking }