nix-files/pkgs/additional/sane-scripts/src/sane-ip-check

6 lines
161 B
Plaintext
Executable File

#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl -p gnugrep
ip=$(curl --silent https://ipinfo.io/ip)
echo "$ip" | grep -P " *^\d+\.\d+\.\d+\.\d+ *$"
exit $?