Created
June 18, 2016 21:29
-
-
Save ch0c01d/784e6cabd80b110dc4c66ddce107054b to your computer and use it in GitHub Desktop.
BASHRC for Ngrok configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ngrok_tunnel() { | |
website=$1 | |
subdomain=$2 | |
username=$3 | |
password=$4 | |
[ -n $website ] && website="-host-header=${website}" || (echo "Onii-sama, dev yg mana yg mau di publish ?" && exit) | |
[ -n $subdomain ] && subdomain="-subdomain=${subdomain}" | |
if [[ -n $username ]] && [[ -n $password ]]; then | |
httpauth="-httpauth=${username}:${password}" | |
echo "Ok Onii-sama, profil akses diubah ke private." | |
else | |
echo "Ok Onii-sama, profil akses diubah ke public." | |
fi | |
ngrok http $website $subdomain 80 $httpauth | |
} | |
#tunnel localhost to public | |
publish() { | |
ngrok_tunnel $1 $2 $3 $4; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment