Comments (7)
Not a problem. Hey, @boolean-is-null. I just looked over the OpenVPN blocklet but haven't done so thoroughly yet (hence the lack of Wiki documentation for the blocklet). I plan to do so in the next couple days. The script looks like it checks for a pid file for each OpenVPN connection /run/openvpn/*.pid
. This is how it checks if you have tunnels or not. I know you said you have them configured to be created. Can you double check if these file(s) exist?
from i3blocks-contrib.
Thank you for the feedback and the effort, really appreciated!
I've just checked and the file /run/openvpn/servername.pid exists and the tun0 device is up..
edit: any news on this issue? I've just checked again with an other vpn server/config and its still the same.
from i3blocks-contrib.
I'm not familiar with perl, nor the used script, but on my system the mentioned scripts (edit: i understand its shared memory):
my $openvpn_enabled='/dev/shm/openvpn_i3blocks_enabled';
my $openvpn_disabled='/dev/shm/openvpn_i3blocks_disabled';
do not really exist. openvpn_i3blocks_disabled
is empty and openvpn_i3blocks_enabled
doesn't exist at all.
PID files definitely exist as /run/openvpn/*.pid
from i3blocks-contrib.
Sorry, I've been busy since the start of school.
The OpenVPN script. If it finds the PID file, it opens it and pulls out the PID. Then it checks the command line of the process /proc/$PID/cmdline
for /--config\s*(.*\.conf)/
that is, it checks for the config.
From this config it looks for a dev
declaration and pulls the interface from /dev\s+(\w+)/
. Next it checks to see if /sys/class/net/$interface
exists. If so, it will display that your VPN is up. If not, it assumes it is down.
To test, between lines 94 and 95, insert the following:
# check if interface exist
+print "$interface"
unless ($interface eq 'null') {
Then run the script. If you see an interface, see if /sys/class/net/$interface
exists. If not, then this script will never work for you. If interface is null, check your config to ensure you have a line dev $interface
.
If you do, cat /proc/$PID/cmdline
(substitute $PID for a valid OpenVPN PID). See if there is something like --config /etc/openvpn/main.conf
.
from i3blocks-contrib.
aaah! Thank you very much for this extensive explanation!
It works now, I had the problem that I ran the openvpn
without --config
, I just used openvpn configfile
. During the testing I also used a config file ending in .ovpn
which I overlooked.
The script also won't work with a relative path to the .conf file, which was another problem I had.
off topic: any clue why the PID files are not deleted for me, when the VPN disconnects?
from i3blocks-contrib.
Haha, I wish I could help there. You would need to check with OpenVPN or your service manager about that. The PID file is their responsibility. It could be how OpenVPN is being closed. For example, if your service manager just SIGKILL's OpenVPN, I doubt it will ensure the PID files are deleted. Or OpenVPN could just be sloppy with PID files. Perhapse OpenVPN suspects that your /run is a tmpfs or that your service manager's initscript (or equivelent) will clean up. I don't use it enough to speak for sure.
As for the limited state of the openvpn script in i3blocks-contrib, I'll be keeping this issue open until I (or anyone else) finds time to better locate OpenVPN interfaces than that 3 step config hunt.
from i3blocks-contrib.
"It works now" assuming this means the issue has been resolved. Reopen if it is not resolved.
from i3blocks-contrib.
Related Issues (20)
- confusing formatting in rofi-calendar
- bandwidth2: missing dependency
- temperature block shows wrong temperature
- The cpu_usage2 blocklet isn't working HOT 1
- The blocklet battery-poly isn't working HOT 2
- only appears the clock with date
- key_layout doesn't work because it doesn't output a \n at the end HOT 1
- Root Makefile errors
- Using Font Awesome 6 instead of Font Awesome 5 for dunst
- apt-upgrades
- Issue with Icons in volume-pipewire
- The memory2 block uses incorrect math to calculate ram usage HOT 1
- volume-pulseaudio higher than 100%
- calendar: calendar display at wrong position for different i3 bar position HOT 2
- [bandwidth] tailscale showing as "down"
- [volume_pulse] grep warning
- [mediaplayer] no output if metadata invalid
- [mediaplayer][rfc] make MPRIS a hard dependency?
- The module `cpu_usage2` doesn't compile with clang/llvm
- Battery-poly not understanding the "Not charging" status HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from i3blocks-contrib.