Skip to content

Instantly share code, notes, and snippets.

@jr-k
Created July 7, 2022 13:47
Show Gist options
  • Save jr-k/cc63363ea6a8a608d6e2c1a0f04baefb to your computer and use it in GitHub Desktop.
Save jr-k/cc63363ea6a8a608d6e2c1a0f04baefb to your computer and use it in GitHub Desktop.
Replace private IP of .env file by your computer's one
#!/bin/bash
ip=$(ifconfig | grep "inet " | grep -v 127.0.0.1 | grep 192.168 | cut -d\ -f2)
sed -E -i '' "s/192.168.[0-9][0-9]?[0-9]?.[0-9][0-9]?[0-9]?/$ip/g" contentplayer-mobile/.env
echo "👻 Updated ip address on env file : $ip"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment