在 main.py 中为 'ssh2' 和 'ssh3' 命令添加支持,并优化 'ls' 和 'update' 命令的处理逻辑
This commit is contained in:
6
main.py
6
main.py
@@ -76,9 +76,11 @@ def pseudo_zsh():
|
|||||||
|
|
||||||
if args[0] == 'l':
|
if args[0] == 'l':
|
||||||
subprocess.run(['ls','-l']) # 执行 ls 命令
|
subprocess.run(['ls','-l']) # 执行 ls 命令
|
||||||
|
continue
|
||||||
|
|
||||||
if args[0] == 'ssh1':
|
if args[0] == 'ssh1':
|
||||||
subprocess.run(['ssh','root@10.147.17.161'])
|
subprocess.run(['ssh','root@10.147.17.161'])
|
||||||
|
continue
|
||||||
|
|
||||||
if args[0] == 'ud' or args[0] == 'update':
|
if args[0] == 'ud' or args[0] == 'update':
|
||||||
try:
|
try:
|
||||||
@@ -91,10 +93,14 @@ def pseudo_zsh():
|
|||||||
os.execv(sys.executable, ['python3'] + sys.argv) # 重新运行程序
|
os.execv(sys.executable, ['python3'] + sys.argv) # 重新运行程序
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error during update: {e}")
|
print(f"Error during update: {e}")
|
||||||
|
|
||||||
if args[0] == 'ssh2':
|
if args[0] == 'ssh2':
|
||||||
subprocess.run(['ssh','admin@10.147.17,160'])
|
subprocess.run(['ssh','admin@10.147.17,160'])
|
||||||
|
continue
|
||||||
|
|
||||||
if args[0] == 'ssh3':
|
if args[0] == 'ssh3':
|
||||||
subprocess.run(['ssh','root'])
|
subprocess.run(['ssh','root'])
|
||||||
|
continue
|
||||||
|
|
||||||
if args[0] == 'sudo':
|
if args[0] == 'sudo':
|
||||||
flight1 = Trueddd
|
flight1 = Trueddd
|
||||||
|
|||||||
Reference in New Issue
Block a user