4c53474ffe
- Add custom rules editor to LUCI web interface - Support 32 rule types (DOMAIN, IP-CIDR, GEOSITE, etc.) - Rule CRUD, sorting, batch import, templates - netflow-rules script for mihomo config injection - Standalone IPK repackaging support
30 lines
921 B
Python
30 lines
921 B
Python
import paramiko, os, time
|
|
time.sleep(3)
|
|
c = paramiko.SSHClient()
|
|
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
c.get_host_keys().clear()
|
|
c.connect('10.10.10.3', 22, 'root', 'zxc9607.', timeout=30, allow_agent=False, look_for_keys=False)
|
|
print('Connected')
|
|
|
|
with c.open_sftp() as s:
|
|
s.put(r'E:\AI Project\WangAgent\luci\luci-app-flclient-v2.ipk', '/tmp/v2.ipk')
|
|
|
|
cmds = (
|
|
'opkg remove luci-app-flclient 2>/dev/null; '
|
|
'rm -rf /tmp/luci-* 2>/dev/null; '
|
|
'opkg install /tmp/v2.ipk 2>&1; '
|
|
'/etc/init.d/uhttpd restart 2>&1; '
|
|
'echo DONE'
|
|
)
|
|
si, so, se = c.exec_command(cmds)
|
|
print(so.read().decode('utf-8', 'replace'))
|
|
err = se.read().decode('utf-8', 'replace')
|
|
if err.strip(): print('ERR:', err)
|
|
|
|
# Verify files
|
|
si, so, se = c.exec_command('ls -la /www/netflow/index.html /usr/lib/lua/luci/controller/netflow.lua 2>/dev/null')
|
|
print(so.read().decode().strip())
|
|
|
|
c.close()
|
|
print('Deployed!')
|