diff --git a/getsestuff b/getsestuff index 96381c2..5e46047 100755 --- a/getsestuff +++ b/getsestuff @@ -152,19 +152,6 @@ def check_repo(root, repo, url=None, branch=None): print(gitconfig.get('remote.origin.url'), 'does not match', url) print(f'{join(root, repo)} exists already') return False - # if repo == 'sea': - # do('mkdir seagit') - # if sim: - # print('> cd seagit') - # else: - # chdir('seagit') - # do('git clone %s' % url) - # do(f'mv sea/.git ../sea/.git') - # if sim: - # print('> cd ..') - # else: - # chdir('..') - # do(f'rm -rf seagit') else: do('git clone %s' % url) pull = True @@ -519,11 +506,6 @@ def remove_line(file, content): todo.add(action) print('remove above') -#def do_monit(): -# """remove monit support for sea / graph""" -# remove_line('%s/monitconfig' % home, 'sea') -# remove_line('%s/monitconfig' % home, 'graph') - selected_instruments = None action_arg = '' @@ -572,6 +554,8 @@ for a in actions: def print_help(): + if not help: + return if remote: inst = " " else: @@ -603,10 +587,12 @@ if remote: docmd(f'sshpass -e ssh {inst}@{inst} getsestuff {action_arg} nohelp') sys.exit(0) + def su_action(action): os.environ['SSHPASS'] = scramble('P[d20+2:1eh') docmd(f'sshpass -e ssh nicos@localhost {sys.argv[0]} {action} nohelp') + if with_su: su_action(action_arg) sys.exit(0) @@ -635,8 +621,7 @@ if action_arg in ('', 'all', 'sim') and nc_actions: print_help() sys.exit(0) -if help: - print_help() - if sim or not action_arg and todo: - print('needs updates: %s' % ' '.join(todo)) +print_help() +if sim or not action_arg and todo: + print('needs updates: %s' % ' '.join(todo))