sane-scripts: lift sane-ip-check out of resholve

This commit is contained in:
Colin 2023-06-06 08:12:42 +00:00
parent 32671201a4
commit 7fcff0b6a2
2 changed files with 8 additions and 2 deletions

View File

@ -26,7 +26,6 @@ let
# see: <https://github.com/abathur/resholve/issues/26>
"bin"
coreutils-full
curl
file
findutils
gnugrep
@ -39,6 +38,7 @@ let
oath-toolkit
openssh
openssl
py-scripts.ip-check
rmlint
rsync
ssh-to-age
@ -157,6 +157,11 @@ let
src = ./src;
pkgs = [ "git" ];
};
ip-check = static-nix-shell.mkBash {
pname = "sane-ip-check";
src = ./src;
pkgs = [ "curl" "gnugrep" ];
};
ip-check-upnp = static-nix-shell.mkPython3Bin {
pname = "sane-ip-check-upnp";
src = ./src;

View File

@ -1,4 +1,5 @@
#!/usr/bin/env bash
#!/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 $?