Compare commits
No commits in common. "master" and "myip-1.0.0" have entirely different histories.
master
...
myip-1.0.0
@ -2,8 +2,7 @@ Welcome to Rx3 MyIP!
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
This is a small tool to return the extern public IP address and optionnally the internal private IP,
|
This is a small tool to return the public IP address.
|
||||||
The internal IP service is also included.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,20 +1,3 @@
|
|||||||
------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
MyIP V 1.1.0 - A. GIBERT - 2025/09/09
|
|
||||||
------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
- Add internal IP reporting to myip command,
|
|
||||||
- Add internal IP service CGI script.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
MyIP V 1.0.1 - A. GIBERT - 2025/07/26
|
|
||||||
------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
- Filter output to remove errors and only keep IP
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
MyIP V 1.0.0 - A. GIBERT - 2025/04/25
|
MyIP V 1.0.0 - A. GIBERT - 2025/04/25
|
||||||
------------------------------------------------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
%define name myip
|
%define name myip
|
||||||
%define version 1.1.0
|
%define version 1.0.0
|
||||||
%define release %mkrel 1rx3
|
%define release %mkrel 1rx3
|
||||||
|
|
||||||
%global debug_package %{nil}
|
%global debug_package %{nil}
|
||||||
@ -50,11 +50,5 @@ install -D -pm 755 %{name} $RPM_BUILD_ROOT%{_bindir}/%{name}
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Tue Sep 9 2025 Arnaud G. GIBERT <arnaud@rx3.net> - 1.1.0-1rx3.mga9
|
|
||||||
- Update to 1.1.0
|
|
||||||
|
|
||||||
* Sat Jul 26 2025 Arnaud G. GIBERT <arnaud@rx3.net> - 1.0.1-1rx3.mga9
|
|
||||||
- Filter output to remove errors and only keep IP
|
|
||||||
|
|
||||||
* Sun Apr 6 2025 Arnaud G. GIBERT <arnaud@rx3.net> - 1.0.0-1rx3.mga9
|
* Sun Apr 6 2025 Arnaud G. GIBERT <arnaud@rx3.net> - 1.0.0-1rx3.mga9
|
||||||
- Create initial SPEC file for 1.0.0 on Mageia 9
|
- Create initial SPEC file for 1.0.0 on Mageia 9
|
||||||
|
51
bin/myip
51
bin/myip
@ -1,52 +1,3 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [[ "$1" == "-h" ]]
|
dig +short myip.opendns.com @resolver1.opendns.com
|
||||||
then
|
|
||||||
echo "myip [-i] | [-a] | [-h]"
|
|
||||||
echo "default: external IP"
|
|
||||||
echo " -i: internal IP"
|
|
||||||
echo " -a: internal + external IP"
|
|
||||||
else
|
|
||||||
if [[ "$1" == "-a" ]]
|
|
||||||
then
|
|
||||||
INT_FLAG="TRUE"
|
|
||||||
EXT_FLAG="TRUE"
|
|
||||||
VERBOSE_FLAG="TRUE"
|
|
||||||
else
|
|
||||||
VERBOSE_FLAG="FALSE"
|
|
||||||
|
|
||||||
if [[ "$1" == "-i" ]]
|
|
||||||
then
|
|
||||||
INT_FLAG="TRUE"
|
|
||||||
EXT_FLAG="FALSE"
|
|
||||||
else
|
|
||||||
INT_FLAG="FALSE"
|
|
||||||
EXT_FLAG="TRUE"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [[ ${VERBOSE_FLAG} == "TRUE" ]]
|
|
||||||
then
|
|
||||||
INT_LABEL="internal_ip: "
|
|
||||||
EXT_LABEL="external_ip: "
|
|
||||||
else
|
|
||||||
INT_LABEL=""
|
|
||||||
EXT_LABEL=""
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [[ ${INT_FLAG} == "TRUE" ]]
|
|
||||||
then
|
|
||||||
INT_IP="$( curl -s http://www.rx3/cgi-bin/myip.cgi | grep -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$')"
|
|
||||||
|
|
||||||
echo "${INT_LABEL}${INT_IP}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ${EXT_FLAG} == "TRUE" ]]
|
|
||||||
then
|
|
||||||
EXT_IP="$( dig +short myip.opendns.com @resolver1.opendns.com | grep -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$')"
|
|
||||||
|
|
||||||
echo "${EXT_LABEL}${EXT_IP}"
|
|
||||||
fi
|
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
echo "Content-type: text/plain"
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
echo "$REMOTE_ADDR"
|
|
Loading…
Reference in New Issue
Block a user