diff --git a/gestion/chsh.py b/gestion/chsh.py index aaca8f49..75eda1ea 100644 --- a/gestion/chsh.py +++ b/gestion/chsh.py @@ -38,9 +38,11 @@ fd=open('/etc/shells') lines=fd.readlines() fd.close() -if not shell in map(str.strip,lines) : +shells = [line for line in lines if not (line.startswith('#') or line.endswith('/rssh'))] + +if not shell in shells: print 'Shell invalide. Les shells valides sont :' - print ''.join(lines[1:]) + print ''.join(shells) sys.exit(4) adh.chsh(shell)