move rsync stuff to thread & make logging & askpasspath stuff compat w thread
This commit is contained in:
47
shared.nim
47
shared.nim
@@ -37,45 +37,16 @@ proc hasCommas*(filename: string):bool =
|
||||
|
||||
proc getAskPassPath*(): string =
|
||||
var askPassPath: string
|
||||
if detectOs(Fedora):
|
||||
if fileExists("/usr/libexec/openssh/ssh-askpass"):
|
||||
askPassPath = "/usr/libexec/openssh/ssh-askpass"
|
||||
else:
|
||||
writeErrorToLog("No ssh-askpass binary found. Please run 'dnf install openssh-askpass'")
|
||||
askPassPath = ""
|
||||
elif detectOs(Ubuntu):
|
||||
if fileExists("/usr/lib/openssh/gnome-ssh-askpass"):
|
||||
askPassPath = "/usr/lib/openssh/gnome-ssh-askpass"
|
||||
else:
|
||||
writeErrorToLog("No ssh-askpass binary found. Please run 'sudo apt install ssh-askpass-gnome'.")
|
||||
askPassPath = ""
|
||||
#save this for a musl build.
|
||||
#[elif detectOs(Alpine):
|
||||
if fileExists("/usr/lib/ssh/gtk-ssh-askpass"):
|
||||
askPassPath = "/usr/lib/ssh/gtk-ssh-askpass"
|
||||
else:
|
||||
writeErrorToLog("No ssh-askpass binary found. Please run 'apk add gtk-ssh-askpass'.")
|
||||
askPassPath = ""]#
|
||||
elif detectOs(ArchLinux):
|
||||
if fileExists("/usr/lib/ssh/ssh-askpass"):
|
||||
askPassPath = "/usr/lib/ssh/ssh-askpass"
|
||||
else:
|
||||
writeErrorToLog("No ssh-askpass binary found. Please run 'pacman -S x11-ssh-askpass', or similar.")
|
||||
askPassPath = ""
|
||||
elif detectOs(Linux):
|
||||
if fileExists("/usr/libexec/openssh/ssh-askpass"):
|
||||
askPassPath = "/usr/libexec/openssh/ssh-askpass"
|
||||
elif fileExists("/usr/lib/openssh/gnome-ssh-askpass"):
|
||||
askPassPath = "/usr/lib/openssh/gnome-ssh-askpass"
|
||||
elif fileExists("/usr/lib/ssh/gtk-ssh-askpass"):
|
||||
askPassPath = "/usr/lib/ssh/gtk-ssh-askpass"
|
||||
elif fileExists("/usr/lib/ssh/ssh-askpass"):
|
||||
askPassPath = "/usr/lib/ssh/ssh-askpass"
|
||||
else:
|
||||
writeErrorToLog("No ssh-askpass binary found. Please install an ssh-askpass package for your distro, and let us know if EZ-Bkup still can't detect it's location.")
|
||||
askPassPath = ""
|
||||
|
||||
if fileExists("/usr/libexec/openssh/ssh-askpass"):
|
||||
askPassPath = "/usr/libexec/openssh/ssh-askpass"
|
||||
elif fileExists("/usr/lib/openssh/gnome-ssh-askpass"):
|
||||
askPassPath = "/usr/lib/openssh/gnome-ssh-askpass"
|
||||
elif fileExists("/usr/lib/ssh/gtk-ssh-askpass"):
|
||||
askPassPath = "/usr/lib/ssh/gtk-ssh-askpass"
|
||||
elif fileExists("/usr/lib/ssh/ssh-askpass"):
|
||||
askPassPath = "/usr/lib/ssh/ssh-askpass"
|
||||
else:
|
||||
writeErrorToLog("Your OS does not appear to be supported at this time. If you are getting this error and you are using a x86_64 gnu libc-based linux distribution please report this issue. Please include the path to your ssh-askpass binary, as well.")
|
||||
askPassPath = ""
|
||||
|
||||
return askPassPath
|
||||
|
||||
Reference in New Issue
Block a user