add quotes for sshpass (for & symbol in password)

This commit is contained in:
ivan 2017-09-05 15:16:23 +03:00
parent afa565104c
commit 083144d656
2 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@ def main():
url='https://github.com/zlaxy/sshch/', url='https://github.com/zlaxy/sshch/',
description='Ssh connection manager', description='Ssh connection manager',
license='DWTWL 2.5', license='DWTWL 2.5',
version='0.6', version='0.7',
py_modules=['sshch'], py_modules=['sshch'],
scripts=['sshch/sshch'], scripts=['sshch/sshch'],

View File

@ -16,7 +16,7 @@ import time
# https://github.com/zlaxy/sshch # https://github.com/zlaxy/sshch
version = "0.6" version = "0.7"
# path to conf file, default: ~/.config/sshch.conf # path to conf file, default: ~/.config/sshch.conf
conf_file = path.expanduser("~") + '/.config/sshch.conf' conf_file = path.expanduser("~") + '/.config/sshch.conf'
@ -53,7 +53,7 @@ def ConnectAlias(alias, command=False):
if conf.has_option(alias, "password"): if conf.has_option(alias, "password"):
password = base64.b32decode(base64.b16decode( password = base64.b32decode(base64.b16decode(
base64.b64decode(conf.get(alias, "password")))) base64.b64decode(conf.get(alias, "password"))))
exec_string = "sshpass -p " + password + " " exec_string = 'sshpass -p "' + password + '" '
exec_string = exec_string + conf.get(alias, "exec_string") exec_string = exec_string + conf.get(alias, "exec_string")
if command: if command:
exec_string = exec_string + " " + command exec_string = exec_string + " " + command