From 3b0ec5be09dcc5b9702aefb774fccd19b1c857bf Mon Sep 17 00:00:00 2001 From: rlbr Date: Tue, 23 Oct 2018 23:52:00 -0500 Subject: [PATCH] Fixed bug regarding prescript being called if None --- ssh-host.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ssh-host.py b/ssh-host.py index 1b4b4f3..4434e03 100755 --- a/ssh-host.py +++ b/ssh-host.py @@ -1,4 +1,3 @@ -#!/usr/bin/python import subprocess import argparse import configparser @@ -14,11 +13,12 @@ if __name__ == "__main__": parser.add_argument('arg',nargs = '*') args = parser.parse_args() - pre = '~/.ssh/config/{}'.format(args.pre_script) + if pre: + pre = '~/.ssh/config/{}'.format(args.pre_script) + subprocess.check_call(pre) if args.wan: host = cp['wan'][args.name] elif args.lan: host = cp['lan'][args.name] cmd = ['ssh','-F','~/.ssh/{}.cfg'.format(args.name),host] + args.arg - subprocess.check_call(pre) subprocess.call(cmd) \ No newline at end of file