Skip to content
This repository has been archived by the owner on May 14, 2021. It is now read-only.

Commit

Permalink
Merge branch 'development' of https://bitbucket.org/privatus/desktop-…
Browse files Browse the repository at this point in the history
…app-ui2 into development
  • Loading branch information
stenya committed Nov 5, 2020
2 parents 037dcf9 + 2f3e58e commit 6cf0ba3
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 15 deletions.
12 changes: 4 additions & 8 deletions References/Linux/package_scripts/after-remove.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,21 @@ silent() {
"$@" > /dev/null 2>&1
}

# STOPPING APPLICATION (same functionality implemented also in 'before-install.sh')
echo "[+] Checking for 'ivpn-ui' running processes ..."
ps aux | grep /opt/ivpn/ui/ivpn-ui.AppImage | grep -v grep
ps aux | grep /opt/ivpn/ui/bin/ivpn-ui | grep -v grep > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "[!] Detected: IVPN app is running"

echo "[+] Disconnecting (if connected) ..."
/usr/local/bin/ivpn disconnect || echo "[-] Failed to disconnect"

echo "[+] Disabling firewall (if enabled) ..."
/usr/local/bin/ivpn firewall -off || echo "[-] Failed to disable firewall"

echo "[+] Killing all 'ivpn-ui' processes ..."
# We should be careful here: WE SHOULD NOT KILL THIS SCRIPT :)
# (which also can have 'ivpn-ui' in process description)
silent kill -TERM $(ps aux | grep /opt/ivpn/ui/ivpn-ui.AppImage | grep -v grep | awk '{print $2}')
silent kill -TERM $(ps aux | grep ivpn-ui | grep /tmp/.mount_ivpn | grep -v grep | awk '{print $2}')
silent kill -TERM $(ps aux | grep /opt/ivpn/ui/bin/ivpn-ui | grep -v grep | awk '{print $2}')
silent sleep 2
silent kill -KILL $(ps aux | grep /opt/ivpn/ui/ivpn-ui.AppImage | grep -v grep | awk '{print $2}')
silent kill -KILL $(ps aux | grep ivpn-ui | grep /tmp/.mount_ivpn | grep -v grep | awk '{print $2}')
silent kill -KILL $(ps aux | grep /opt/ivpn/ui/bin/ivpn-ui | grep -v grep | awk '{print $2}')
fi

# DEB argument on upgrade - 'upgrade'; RPM - '1'
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ivpn-ui",
"version": "3.1.5",
"version": "3.1.10",
"description": "IVPN Client",
"author": "IVPN Limited",
"license": "GPL-3.0",
Expand Down
3 changes: 2 additions & 1 deletion src/components/settings/settings-account.vue
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ export default {
console.error(e);
dialog.showMessageBoxSync(getCurrentWindow(), {
type: "error",
message: "Failed to log out. Please check connectivity.",
message: "Failed to log out.",
detail: e,
buttons: ["OK"]
});
} finally {
Expand Down
27 changes: 23 additions & 4 deletions src/daemon-client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,17 @@ async function sendRecv(request, waitRespCommandsList, timeoutMs) {

return promise;
}

function commitNoSession() {
const session = {
AccountID: "",
Session: "",
WgPublicKey: "",
WgLocalIP: "",
WgKeyGenerated: new Date(),
WgKeysRegenIntervalSec: 0
};
commitSession(session);
}
function commitSession(sessionRespObj) {
if (sessionRespObj == null) return;
const session = {
Expand Down Expand Up @@ -602,9 +612,18 @@ async function Logout() {
await KillSwitchSetIsPersistent(false);
await EnableFirewall(false);
await Disconnect();
await sendRecv({
Command: daemonRequests.SessionDelete
});
try {
await sendRecv({
Command: daemonRequests.SessionDelete
});
} catch (e) {
console.error(e);
}

// It can happen that there will be no CONNECTION TO API or error on backend side
// In this case the daemon will not logout.
// Here we manually removing local session info
commitNoSession();
}

async function AccountStatus() {
Expand Down

0 comments on commit 6cf0ba3

Please sign in to comment.