Commit 1e8d930e authored by guanghongwei's avatar guanghongwei

del import module

parent e4c6823e
...@@ -6,11 +6,10 @@ import os ...@@ -6,11 +6,10 @@ import os
import select import select
import time import time
import paramiko import paramiko
import sys
import struct import struct
import fcntl import fcntl
import signal import signal
import socket
try: try:
import termios import termios
...@@ -117,8 +116,8 @@ def connect(username, password, host, port): ...@@ -117,8 +116,8 @@ def connect(username, password, host, port):
""" """
Connect server. Connect server.
""" """
ps1 = "PS1='[\u@%s \W]\$ '\n" % host
ps1 = "'[\u@%s \W]\$ '\n" % host login_msg = "clear;echo -e '\\033[32mLogin %s done. Enjoy it.\\033[0m'\n" % host
# Make a ssh connection # Make a ssh connection
ssh = paramiko.SSHClient() ssh = paramiko.SSHClient()
...@@ -141,9 +140,9 @@ def connect(username, password, host, port): ...@@ -141,9 +140,9 @@ def connect(username, password, host, port):
except: except:
pass pass
# Modify PS1 # set PS1 and msg it
channel.send('PS1=%s' % ps1) channel.send(ps1)
channel.send("clear;echo -e '\\033[32mLogin %s done. Enjoy it.\\033[0m'\n" % host) channel.send(login_msg)
# Make ssh interactive tunnel # Make ssh interactive tunnel
posix_shell(channel, username, host) posix_shell(channel, username, host)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment