Author |
Message |
enrique
Joined: 09 Nov 2019 Posts: 601 Location: Planet Earth
|
Posted: Sat 28 Dec 2019, 04:43 Post subject:
|
|
@OscarTalks nice catch. I been busy to little time to work, I should have seen it did not show "NO Network". Funny I did test yours and found it did not work for me. That is why I made some changes. And now I also realize I did not say anything. Sorry. I need to be more alert in the future.
For the record grep "state UP" -A2 does work for me.
I am using BusterDog64. Ip Vesion Code: | root@live:~# ip -V
ip utility, iproute2-ss190107 |
With network I get Code: | root@live:~# ip address show | grep "state UP" -A2 | grep inet | echo $?
127 |
Without Network I get Code: | root@live:~# ip address show | grep "state UP" -A2 | grep inet | echo $?
0 |
So after the correction if [ -z "$UpLink" ]; All work fine with me.
Let me see if I had time today for the rotate ovpn script. See I am using you guys jafadmin & OscarTalks as an excuse to learn bash. I do write in C but bash is for the most part new to me. Do not get me wrong I can follow a program. Writing one from of my own is another story. HEHEHEHE
|
Back to top
|
|
 |
OscarTalks

Joined: 05 Feb 2012 Posts: 2202 Location: London, England
|
Posted: Sat 28 Dec 2019, 17:30 Post subject:
|
|
The string "state UP" is present in BionicPup32 so it works.
Unfortunately not so in Stretch and not in Wheezy either.
The executable ip is a symlink to busybox in all cases
Stretch with no VPN
Code: | # ip address show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq qlen 1000
link/ether 84:2b:2b:95:6f:95 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.14/24 brd 192.168.1.255 scope global eth0
valid_lft forever preferred_lft forever
# |
Stretch with OpenVPN connected
Code: | # ip address show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq qlen 1000
link/ether 84:2b:2b:95:6f:95 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.14/24 brd 192.168.1.255 scope global eth0
valid_lft forever preferred_lft forever
3: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 100
link/[65534]
inet 10.211.1.177 peer 10.211.1.178/32 scope global tun0
valid_lft forever preferred_lft forever
# |
Wheezy with no VPN
Code: | # ip address show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq qlen 1000
link/ether 84:2b:2b:95:6f:95 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.12/24 brd 192.168.1.255 scope global eth0
# |
Wheezy with OpenVPN connected
Code: | # ip address show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq qlen 1000
link/ether 84:2b:2b:95:6f:95 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.12/24 brd 192.168.1.255 scope global eth0
3: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 100
link/[65534]
inet 10.211.1.197 peer 10.211.1.198/32 scope global tun0
# |
_________________ Oscar in England

|
Back to top
|
|
 |
jafadmin
Joined: 19 Mar 2009 Posts: 1258
|
Posted: Sat 28 Dec 2019, 18:06 Post subject:
|
|
Thanks, Oscar. I think we can use "MULTICAST,UP" instead. It seems to work on both.
I've changed the script download.
Thanks for the testing.
|
Back to top
|
|
 |
foxpup
Joined: 29 Jul 2016 Posts: 1141
|
Posted: Sun 29 Dec 2019, 09:37 Post subject:
... should be used to make a P2P PuppyPhone call?... Subject description: 2 ports for psip? |
|
@enrique very nice instructions for puppyphone with IP!!
enrique wrote: | Now you need to know the Port PuppyPhone is using:
Code: | netstat -peanut | grep psip |
|
When I try this I get 2 ports, 5060 and 5061:
Code: | root# netstat -peanut | grep psip
tcp 0 0 0.0.0.0:5060 0.0.0.0:* LISTEN 0 91578 29175/./psip64
tcp 0 0 0.0.0.0:5061 0.0.0.0:* LISTEN 0 91582 29175/./psip64
udp 0 0 0.0.0.0:5060 0.0.0.0:* 0 91575 29175/./psip64 | Any idea what this means?
I don't use VPN.
|
Back to top
|
|
 |
enrique
Joined: 09 Nov 2019 Posts: 601 Location: Planet Earth
|
Posted: Sun 29 Dec 2019, 15:31 Post subject:
|
|
To prevent hijack I answer you here Please sugest: Internet Phone SIP
|
Back to top
|
|
 |
gabtech
Joined: 14 Apr 2013 Posts: 107
|
Posted: Tue 31 Dec 2019, 06:22 Post subject:
New netinfo.yad |
|
Hi yafadmin
The new netinfo script does not work correctly in stretchdog 32. The old one works correctly. The new scripts produces a No network status while the old script gives me the public ip.
|
Back to top
|
|
 |
jafadmin
Joined: 19 Mar 2009 Posts: 1258
|
Posted: Tue 31 Dec 2019, 13:44 Post subject:
Re: New netinfo.yad |
|
gabtech wrote: | Hi yafadmin
The new netinfo script does not work correctly in stretchdog 32. The old one works correctly. The new scripts produces a No network status while the old script gives me the public ip. |
There is some kind of difference in the output of the network tools between various versions of Linux.
either the phrase "MULTICAST,UP" or "state UP" should work for the line:
Code: | UpLink=$(ip address show | grep "state UP" -A2 | grep inet|xargs )
UpLink=$(ip address show | grep "MULTICAST,UP" -A2 | grep inet|xargs ) |
Just use whichever works with your version.
Naturally, this has not been tested with ALL versions of puppy linux. That level of testing is beyond my time and resources ..
|
Back to top
|
|
 |
enrique
Joined: 09 Nov 2019 Posts: 601 Location: Planet Earth
|
Posted: Wed 01 Jan 2020, 09:26 Post subject:
|
|
As a report, I did try it on Buterdog64 and bionic32. For mi "MULTICAST,UP" does the job.
gabtech Can you post your result in stretchdog 32 to just
Last edited by enrique on Wed 01 Jan 2020, 19:35; edited 1 time in total
|
Back to top
|
|
 |
fredx181

Joined: 11 Dec 2013 Posts: 4481 Location: holland
|
Posted: Wed 01 Jan 2020, 12:15 Post subject:
|
|
Quote: | either the phrase "MULTICAST,UP" or "state UP" should work for the line:
Code:
UpLink=$(ip address show | grep "state UP" -A2 | grep inet|xargs )
UpLink=$(ip address show | grep "MULTICAST,UP" -A2 | grep inet|xargs ) |
On my Stretchdog 32 system:
With ethernet cable plugged in (same output for both):
Code: | root@live:~# ip address show | grep "state UP" -A2 | grep inet|xargs
inet 192.168.1.4/24 brd 192.168.1.255 scope global eth0
root@live:~# ip address show | grep "MULTICAST,UP" -A2 | grep inet|xargs
inet 192.168.1.4/24 brd 192.168.1.255 scope global eth0
root@live:~# |
With cable unplugged (first command output is empty):
Code: | root@live:~# ip address show | grep "state UP" -A2 | grep inet|xargs
root@live:~# ip address show | grep "MULTICAST,UP" -A2 | grep inet|xargs
inet6 fe80::222:64ff:fe4d:6c17/64 scope link
root@live:~# |
EDIT: With cable plugged in, full output of ip address show
Code: | 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:22:64:4d:6c:17 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.4/24 brd 192.168.1.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::222:64ff:fe4d:6c17/64 scope link
valid_lft forever preferred_lft forever
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether 00:1b:77:16:3a:10 brd ff:ff:ff:ff:ff:ff |
With cable unplugged:
Code: | root@live:~# ip address show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether 00:22:64:4d:6c:17 brd ff:ff:ff:ff:ff:ff
inet6 fe80::222:64ff:fe4d:6c17/64 scope link
valid_lft forever preferred_lft forever
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether 00:1b:77:16:3a:10 brd ff:ff:ff:ff:ff:ff |
Fred
_________________ Dog Linux website
Tinylinux blog by wiak
|
Back to top
|
|
 |
fredx181

Joined: 11 Dec 2013 Posts: 4481 Location: holland
|
Posted: Wed 01 Jan 2020, 13:02 Post subject:
|
|
Following up on previous post, IMO, the best way (and portable between different OS's) to check for network connection is to use curl "<some common website>" in this case using "https://duckduckgo.com" , then in the script:
Code: | ### If "$UpLink" is blank we cannot collect info, so exit ..
#if [ -z "$UpLink" ]; then yad --info --timeout=30 --height=100 --width=100 --center --title="Network Status" --text="$(printf "\n\t NO Network\n")" &
# exit 0
#fi
# check if there is network connection using curl, replacing the above commented out
case "$(curl -s --retry-delay 3 --retry 3 --max-time 10 -I https://duckduckgo.com | sed 's/^[^ ]* *\([0-9]\).*/\1/; 1q')" in
[23]) echo "OK, there is network connection, continue..." ;;
*) yad --info --timeout=30 --height=100 --width=100 --center --title="Network Status" --text="$(printf "\n\t NO Network\n")" &
exit 0 ;;
esac
|
Fred
_________________ Dog Linux website
Tinylinux blog by wiak
|
Back to top
|
|
 |
ETP

Joined: 19 Oct 2010 Posts: 1202 Location: UK
|
Posted: Wed 01 Jan 2020, 18:41 Post subject:
|
|
Choice is a fine thing.
Here is a link to a dynamic utility to give an on-screen display.
http://murga-linux.com/puppy/viewtopic.php?p=978652&search_id=2005232242#978652
(Requires basic conky)
EDIT: 4th January 2020 - Please note that it is not suitable for use with Debian Dogs.
_________________ Regards ETP
Kennels
Last edited by ETP on Sat 04 Jan 2020, 10:17; edited 1 time in total
|
Back to top
|
|
 |
enrique
Joined: 09 Nov 2019 Posts: 601 Location: Planet Earth
|
Posted: Wed 01 Jan 2020, 19:55 Post subject:
|
|
I am on BusterDog64 and it has Conky as default. I try to manually install but show nothing. One thing is missing "/root/.config/wallpaper/bg_img" where can I find this?
Edit: After doing conkytogle I have NET:EXT: ***.***.*** over IP(wlan0): ###.###.###. But this value never gets updated if I start VPN or STOP?
What I am doing wrong?
|
Back to top
|
|
 |
jamesbond
Joined: 26 Feb 2007 Posts: 3475 Location: The Blue Marble
|
Posted: Thu 02 Jan 2020, 07:28 Post subject:
|
|
My version, as a way to say thanks. May this be useful for those who need it.
Code: | #!/bin/sh
# Inspiration: http://murga-linux.com/puppy/viewtopic.php?t=117675
TMP=/tmp/ipinfo.$$
cat > $TMP << EOF
Local IP Address(es)
--------------------
$(
ifconfig | sed -n '/^[a-z].*:/ {s/:.*/:/; N; /inet /!d; s/:.*inet /: /; s/[ ]*netmask.*//; H}; ${x;s/^\n//;p}'
)
Remote IP address
-----------------
$(curl -s https://geoip.ubuntu.com/lookup | xml2 | sed 's|/Response/||; s/=/: /')
EOF
[ -z "$DISPLAY" ] && cat "$TMP" ||
Xdialog --fixed-font --title "Network Info" --no-cancel --editbox "$TMP" 0 0 2> /dev/null
rm -f $TMP
|
For this to work, you need "xml2" which "flattens" XML to a line-oriented format (which then you can process with grep/sed/awk/etc). The original source of this small nifty utility has been blown away by time, but fortunately Debian folks keeps a copy for us.
_________________ Fatdog64 forum links: Latest version | Contributed packages | ISO builder
|
Back to top
|
|
 |
enrique
Joined: 09 Nov 2019 Posts: 601 Location: Planet Earth
|
Posted: Thu 02 Jan 2020, 10:46 Post subject:
|
|
@jamesbond Your script works very nice. One more sample for my collections.
Now to be honest YOU MADE MY DAY. I like to work in many projects. One of then was in Real Need of your suggested xml2. As this too parse also HTML. So THANK YOU.
|
Back to top
|
|
 |
ETP

Joined: 19 Oct 2010 Posts: 1202 Location: UK
|
Posted: Thu 02 Jan 2020, 10:51 Post subject:
|
|
enrique wrote: | I am on BusterDog64 and it has Conky as default. I try to manually install but show nothing. One thing is missing "/root/.config/wallpaper/bg_img" where can I find this?
Edit: After doing conkytogle I have NET:EXT: ***.***.*** over IP(wlan0): ###.###.###. But this value never gets updated if I start VPN or STOP?
What I am doing wrong? |
Hi enrique,
Sorry my fault, I did not realise that you were using BusterDog64.
The .pet I linked to is only suitable for Pups such as Bionicpup64 8.0
and easyos.
_________________ Regards ETP
Kennels
|
Back to top
|
|
 |
|