sane-scripts: lift sane-ip-check
out of resholve
This commit is contained in:
@@ -26,7 +26,6 @@ let
|
|||||||
# see: <https://github.com/abathur/resholve/issues/26>
|
# see: <https://github.com/abathur/resholve/issues/26>
|
||||||
"bin"
|
"bin"
|
||||||
coreutils-full
|
coreutils-full
|
||||||
curl
|
|
||||||
file
|
file
|
||||||
findutils
|
findutils
|
||||||
gnugrep
|
gnugrep
|
||||||
@@ -39,6 +38,7 @@ let
|
|||||||
oath-toolkit
|
oath-toolkit
|
||||||
openssh
|
openssh
|
||||||
openssl
|
openssl
|
||||||
|
py-scripts.ip-check
|
||||||
rmlint
|
rmlint
|
||||||
rsync
|
rsync
|
||||||
ssh-to-age
|
ssh-to-age
|
||||||
@@ -157,6 +157,11 @@ let
|
|||||||
src = ./src;
|
src = ./src;
|
||||||
pkgs = [ "git" ];
|
pkgs = [ "git" ];
|
||||||
};
|
};
|
||||||
|
ip-check = static-nix-shell.mkBash {
|
||||||
|
pname = "sane-ip-check";
|
||||||
|
src = ./src;
|
||||||
|
pkgs = [ "curl" "gnugrep" ];
|
||||||
|
};
|
||||||
ip-check-upnp = static-nix-shell.mkPython3Bin {
|
ip-check-upnp = static-nix-shell.mkPython3Bin {
|
||||||
pname = "sane-ip-check-upnp";
|
pname = "sane-ip-check-upnp";
|
||||||
src = ./src;
|
src = ./src;
|
||||||
|
@@ -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)
|
ip=$(curl --silent https://ipinfo.io/ip)
|
||||||
echo "$ip" | grep -P " *^\d+\.\d+\.\d+\.\d+ *$"
|
echo "$ip" | grep -P " *^\d+\.\d+\.\d+\.\d+ *$"
|
||||||
exit $?
|
exit $?
|
||||||
|
Reference in New Issue
Block a user