Skip to content

Instantly share code, notes, and snippets.

@nemanjan00
Created August 5, 2018 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nemanjan00/bb0139bfc829ba4c2fe5be2610d31d64 to your computer and use it in GitHub Desktop.
Save nemanjan00/bb0139bfc829ba4c2fe5be2610d31d64 to your computer and use it in GitHub Desktop.
Remove hostname for NetworkManager + dhcpcd

Just replace nemanjan00-laptop with your hostname, move /usr/bin/dhcpcd to /usr/bin/dhcpcd_old and move dhcpcd to /usr/bin/dhcpcd

#!/bin/bash
ARGS=()
for var in "$@"; do
# Ignore known bad arguments
[ "$var" != '-h' ] && [ "$var" != 'nemanjan00-laptop' ] && ARGS+=("$var")
done
echo "${ARGS[@]}"
/usr/bin/dhcpcd_old "${ARGS[@]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment