Author SHA1 Message Date
root a0760861f0 fix: dns nameservers 2026-04-14 17:22:41 +04:00
root f554f9cda4 cosmetic: terminal output 2026-04-14 16:01:11 +04:00
2 changed files with 7 additions and 3 deletions
+3
View File
@@ -160,6 +160,9 @@ case "$1" in
if [ -n "$SELECTED_PATH" ]; then if [ -n "$SELECTED_PATH" ]; then
[ "$s_choice" -eq 2 ] && { cp "$SELECTED_PATH" /tmp/restore.tar.gz; SELECTED_PATH="/tmp/restore.tar.gz"; umount "$S_MOUNT"; } [ "$s_choice" -eq 2 ] && { cp "$SELECTED_PATH" /tmp/restore.tar.gz; SELECTED_PATH="/tmp/restore.tar.gz"; umount "$S_MOUNT"; }
sysupgrade -r "$SELECTED_PATH" sysupgrade -r "$SELECTED_PATH"
echo "Summary:"
echo " [+] Restoring configs completed"
echo " [!] Reboot required"
fi fi
;; ;;
2) 2)
+4 -3
View File
@@ -13,6 +13,7 @@ fix_dns() {
local dns2="1.0.0.1" local dns2="1.0.0.1"
if ! grep -q "$dns1" /etc/resolv.conf; then if ! grep -q "$dns1" /etc/resolv.conf; then
printf "Patching DNS for restore... " printf "Patching DNS for restore... "
sed -i '/^nameserver/d' /etc/resolv.conf
sed -i "1i nameserver $dns1" /etc/resolv.conf sed -i "1i nameserver $dns1" /etc/resolv.conf
sed -i "2i nameserver $dns2" /etc/resolv.conf sed -i "2i nameserver $dns2" /etc/resolv.conf
echo "OK" echo "OK"
@@ -75,7 +76,7 @@ case "$CMD" in
echo "Installing packages:" echo "Installing packages:"
for pkg in $(cat "$LOCAL_LST"); do for pkg in $(cat "$LOCAL_LST"); do
if opkg list-installed | grep -q "^$pkg "; then if opkg list-installed | grep -q "^$pkg "; then
echo " [s] $pkg... is already installed" echo " [=] $pkg... is already installed"
else else
fix_dns fix_dns
printf " [+] $pkg... " printf " [+] $pkg... "
@@ -88,7 +89,7 @@ case "$CMD" in
done done
[ -f /etc/resolv.conf-backup ] && mv /etc/resolv.conf-backup /etc/resolv.conf [ -f /etc/resolv.conf-backup ] && mv /etc/resolv.conf-backup /etc/resolv.conf
echo "Summary:" echo "Summary:"
echo " Restore complete." echo " [+] Restoring packages completed"
echo " Reboot is recommended." echo " [!] Reboot required"
;; ;;
esac esac