Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[nemo-qml-plugin-systemsettings] Add support for automatically enable…
…d VPNs
- Loading branch information
1 parent
a8337b7
commit 9e33326
Showing
6 changed files
with
176 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[Unit] | ||
Description=Automatic up/down for configured VPN connections | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=/usr/bin/vpn-updown.sh up | ||
ExecStop=/usr/bin/vpn-updown.sh down | ||
RemainAfterExit=yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
if [ $# -lt 1 ]; then | ||
echo "Usage: $0 up|down" | ||
exit 1 | ||
fi | ||
|
||
METHOD= | ||
if [ "$1" = "up" ]; then | ||
METHOD=net.connman.vpn.Connection.Connect | ||
elif [ "$1" = "down" ]; then | ||
METHOD=net.connman.vpn.Connection.Disconnect | ||
else | ||
echo "Usage: $0 up|down" | ||
exit 2 | ||
fi | ||
|
||
logger "$0 $1" | ||
for FILE in $(find /home/nemo/.local/share/system/vpn -mindepth 1 -maxdepth 1); do | ||
TOKEN=$(basename $FILE) | ||
OBJECTPATH=/net/connman/vpn/connection/$TOKEN | ||
/bin/dbus-send --system --dest=net.connman.vpn --print-reply $OBJECTPATH $METHOD | ||
logger "Invoked $METHOD for $OBJECTPATH" | ||
done | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters