nano ip.py import os fp = os.popen('ifconfig') txt = fp.read() print(txt)
nano getip.sh python3 /root/ip.py> /home/$(date +%Y-%m-%d-%H:%M:%S).log 2>&1 &
在exit 0前面写入
/root/getip.sh&