Commit 109ad3fa authored by dmknght's avatar dmknght

move kill app to standalone module

parent a3eba36d
Pipeline #1187 canceled with stages
......@@ -2,38 +2,11 @@ import strutils
import osproc
import os
import displays / noti
import modules / [myip, changeid]
import modules / [myip, changeid, cleaner]
import .. / utils / services
import cli / [cores, help]
proc askUser(): bool =
if not isDesktop:
return cliUserAsk()
else:
discard # TODO use select box of question here
proc killApps() =
const
killCommand = "killall -q chrome dropbox skype icedove thunderbird firefox firefox-esr chromium xchat hexchat transmission steam firejail /usr/lib/firefox/firefox"
cacheCommand = "bleachbit -c adobe_reader.cache chromium.cache chromium.current_session chromium.history elinks.history emesene.cache epiphany.cache firefox.url_history flash.cache flash.cookies google_chrome.cache google_chrome.history links2.history opera.cache opera.search_history opera.url_history &> /dev/null"
if askUser():
let
killResult = execCmd(killCommand)
cacheResult = execCmd(cacheCommand)
if killResult == 0 and cacheResult == 0:
if isDesktop:
sendNotify("AnonSurf", "Killed dangerous application", "security-high")
else:
echo "[*] Killed dangerous applications"
else:
if isDesktop:
sendNotify("AnonSurf", "Error while trying to kill applications", "security-medium")
else:
echo "[!] Error while trying to kill dangerous applications"
proc checkIP() =
sendNotify("My IP", "Getting data from server", "dialog-information")
let info = checkIPFromTorServer()
......@@ -57,6 +30,20 @@ proc checkIP() =
echo "[!] You are under Tor network\n" & info[1]
proc killApps() =
let killResult = doKillApps()
if killResult == 0:
if isDesktop:
sendNotify("AnonSurf", "Killed dangerous application", "security-high")
else:
echo "[*] Killed dangerous applications"
else:
if isDesktop:
sendNotify("AnonSurf", "Error while trying to kill applications", "security-medium")
else:
echo "[!] Error while trying to kill dangerous applications"
proc start() =
# start daemon
# Check if all services are started
......
import osproc
import .. / cli / cores
proc askUser(): bool =
if not isDesktop:
return cliUserAsk()
else:
discard # TODO use select box of question here
proc doKillAppsFromCli*(): int =
#[
Ask if user want to kill dangerous applications.
If user has DE: Create a pop up with standalone
gtk application
Else: create a while loop to ask Y/N question
This module is for CLI only
]#
const
killCommand = "killall -q chrome dropbox skype icedove thunderbird firefox firefox-esr chromium xchat hexchat transmission steam firejail /usr/lib/firefox/firefox"
cacheCommand = "bleachbit -c adobe_reader.cache chromium.cache chromium.current_session chromium.history elinks.history emesene.cache epiphany.cache firefox.url_history flash.cache flash.cookies google_chrome.cache google_chrome.history links2.history opera.cache opera.search_history opera.url_history &> /dev/null"
if askUser():
let
killResult = execCmd(killCommand)
cacheResult = execCmd(cacheCommand)
return killResult + cacheResult
proc doKillAppsFromGUI*(): int =
#[
Ask if user want to kill dangerous applications.
This module for GUI (AnonSurfGTK)
]#
discard
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment