{"action":"created","issue":{"url":"https://api.github.com/repos/vivien/i3blocks-contrib/issues/5","labels_url":"https://api.github.com/repos/vivien/i3blocks-contrib/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/vivien/i3blocks-contrib/issues/5/comments","events_url":"https://api.github.com/repos/vivien/i3blocks-contrib/issues/5/events","html_url":"https://github.com/vivien/i3blocks-contrib/issues/5","id":103931444,"number":5,"title":"openvpn state always down","user":{"login":"vivien","id":285808,"avatar_url":"https://avatars.githubusercontent.com/u/285808?v=3","gravatar_id":"","url":"https://api.github.com/users/vivien","html_url":"https://github.com/vivien","followers_url":"https://api.github.com/users/vivien/followers","following_url":"https://api.github.com/users/vivien/following{/other_user}","gists_url":"https://api.github.com/users/vivien/gists{/gist_id}","starred_url":"https://api.github.com/users/vivien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vivien/subscriptions","organizations_url":"https://api.github.com/users/vivien/orgs","repos_url":"https://api.github.com/users/vivien/repos","events_url":"https://api.github.com/users/vivien/events{/privacy}","received_events_url":"https://api.github.com/users/vivien/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-30T15:47:30Z","updated_at":"2015-09-25T17:27:14Z","closed_at":null,"body":"I'm transfering @boolean-is-null's issue https://github.com/vivien/i3blocks/issues/132 here since the *openvpn* blocklet has been moved to contrib."},"comment":{"url":"https://api.github.com/repos/vivien/i3blocks-contrib/issues/comments/143294896","html_url":"https://github.com/vivien/i3blocks-contrib/issues/5#issuecomment-143294896","issue_url":"https://api.github.com/repos/vivien/i3blocks-contrib/issues/5","id":143294896,"user":{"login":"Nycroth","id":6979898,"avatar_url":"https://avatars.githubusercontent.com/u/6979898?v=3","gravatar_id":"","url":"https://api.github.com/users/Nycroth","html_url":"https://github.com/Nycroth","followers_url":"https://api.github.com/users/Nycroth/followers","following_url":"https://api.github.com/users/Nycroth/following{/other_user}","gists_url":"https://api.github.com/users/Nycroth/gists{/gist_id}","starred_url":"https://api.github.com/users/Nycroth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nycroth/subscriptions","organizations_url":"https://api.github.com/users/Nycroth/orgs","repos_url":"https://api.github.com/users/Nycroth/repos","events_url":"https://api.github.com/users/Nycroth/events{/privacy}","received_events_url":"https://api.github.com/users/Nycroth/received_events","type":"User","site_admin":false},"created_at":"2015-09-25T17:27:14Z","updated_at":"2015-09-25T17:27:14Z","body":"Sorry, I've been busy since the start of school.\r\n\r\nThe 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.\r\n\r\nFrom 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.\r\n\r\nTo test, between lines 94 and 95, insert the following:\r\n```perl\r\n# check if interface exist\r\nprint \"$interface\"\r\nunless ($interface eq 'null') {\r\n```\r\n\r\nThen 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`."}}