Add new menu "Install permanent SSH"

This commit is contained in:
remittor
2022-09-17 13:15:38 +03:00
parent 82ab90b39e
commit 82a40aa2b3
5 changed files with 94 additions and 2 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/bin/sh
if [ "$( grep 'ssh_patch.sh' /etc/crontabs/root )" != "" ]; then
sh /tmp/ssh_uninstall.sh
fi
mv -f /tmp/ssh_patch.sh /etc/crontabs/
chmod +x /etc/crontabs/ssh_patch.sh
nvram set ssh_en=1
nvram commit
grep -v "/etc/crontabs/ssh_patch.sh" /etc/crontabs/root > /etc/crontabs/root.new;
echo "*/1 * * * * /etc/crontabs/ssh_patch.sh >/dev/null 2>&1" >> /etc/crontabs/root.new
mv /etc/crontabs/root.new /etc/crontabs/root
/etc/init.d/cron restart