Closed CodeGorila closed 2 months ago
I am interested in your answer. However, in the interim, for others, I had to create a shell script with expect/send:
/usr/bin/expect <<EOD
spawn protonvpn-cli login YourUserNameHere
expect "Enter your Proton VPN password*"
send "YourPasswordHere\r"
expect eof
spawn protonvpn-cli c -f
expect eof
EOD
Closing this ticket as it's not relevant for this project.
Hi @natanjunges, don't you have to call protonvpn-cli login first? Also, how do you specify the password as it isn't an argument to the command?
I created a systemd service in user space, as @calexandru2018 mentioned. It works quite well, it waits for
network-online.target
(it needs NetworkManager to be fully initialized), connects automatically, opens the GUI and disconnects automatically on logout. It also restarts itself in case it fails to start.To use it, just save it in
~/.config/systemd/user/protonvpn-autostart.service
, reload the systemd daemon withsystemctl --user daemon-reload
and enable it withsystemctl --user enable protonvpn-autostart
.I could not get it working reliably with Kill Switch enabled at first, but the solution from https://github.com/ProtonVPN/linux-cli/issues/44#issuecomment-911701915 seems to have worked. Just insert these two lines after
RemainAfterExit=yes
:Then reload the systemd daemon with
systemctl --user daemon-reload
.Originally posted by @natanjunges in https://github.com/ProtonVPN/linux-app/issues/4#issuecomment-953313052