1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

read -p "请输入要操作的会话数量: " session_count
read -p "要执行命令还是清除会话?(执行命令输入 'run',清除会话输入 'clear'): " choice

for ((i=1; i<=session_count; i++)); do
session_name="wy$i"

if [ "$choice" == "run" ]; then
screen -dmS $session_name
screen -S $session_name -X stuff "python wy.py\n"
elif [ "$choice" == "clear" ]; then
screen -S $session_name -X quit
else
echo "无效选项,请输入 'run' 或 'clear'."
fi
done
1
ip -6 a | grep /64 | awk -F '[ \t]+|/' '$3 == "::1" { next;} $3 ~ /^fe80::/ { next;} /inet6/ {print $3}'