Skip to content

Instantly share code, notes, and snippets.

@meistermeier
Last active April 30, 2024 14:53
Show Gist options
  • Save meistermeier/4713c3ed733fbb8d79220cb78997ebaf to your computer and use it in GitHub Desktop.
Save meistermeier/4713c3ed733fbb8d79220cb78997ebaf to your computer and use it in GitHub Desktop.
iphone hotspot config
#!/usr/bin/env bash
if [[ -z $1 || $1 == "off" ]]; then
echo "Resetting Wi-Fi to DHCP"
networksetup -setdhcp Wi-Fi
exit 0
fi
if [[ $1 == "on" ]]; then
echo "Setting manual ip address"
networksetup -setmanual Wi-Fi 172.20.10.3 255.255.255.240 172.20.10.1
exit 0
fi
echo "meistermeier did something wrong."
exit 1
@meistermeier
Copy link
Author

./iphone_hotspot.sh off use dhcp
./iphone_hotspot.sh on use static ip config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment