I am a big supporter of the approach to indent with tabs and align with
spaces. (Read [here][1] f.e.) Thus at some places a simple `s/ {4}/\t/g`
(replace 4 with whatever fits) is not enough and a bit more thought is
needed. Because of that there are still places where I plan to
substitute the whitespace in the future.
This patch contains exclusively whitespace changes. Check for yourself
with `git diff --ignore-all-space`.
[1]: https://dmitryfrank.com/articles/indent_with_tabs_align_with_spaces
18 lines
360 B
Bash
Executable File
18 lines
360 B
Bash
Executable File
#!/bin/sh
|
|
|
|
connection="$(nmcli con show --active | awk '$3 ~ /^(vpn|tun)$/ { print $1 }')"
|
|
if [ -n "$connection" ]; then
|
|
echo "VPN: $connection"
|
|
exit 0
|
|
fi
|
|
|
|
# [o] is a hack to not grep the grep-command. See:
|
|
# https://stackoverflow.com/questions/9375711/more-elegant-ps-aux-grep-v-grep
|
|
if ps ax | grep -q "[o]penvpn"; then
|
|
echo "VPN"
|
|
exit 0
|
|
fi
|
|
|
|
echo
|
|
exit 1
|