|
@@ -1,8 +1,52 @@
|
|
|
#! /bin/sh
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
-CURRENT_PATH=`pwd`
|
|
|
|
|
|
|
+# 配置文件路径
|
|
|
|
|
+DNS_CONFIG_FILE="/etc/dnsmasq.conf"
|
|
|
|
|
+
|
|
|
|
|
+# 恢复DNS配置
|
|
|
|
|
+echo "正在恢复DNS配置..."
|
|
|
|
|
+cat > "$DNS_CONFIG_FILE" << EOF
|
|
|
|
|
+interface=eth0
|
|
|
|
|
+no-hosts
|
|
|
|
|
+no-resolv
|
|
|
|
|
+
|
|
|
|
|
+server=8.8.8.8
|
|
|
|
|
+server=114.114.114.114
|
|
|
|
|
+EOF
|
|
|
|
|
+
|
|
|
|
|
+killall dnsmasq; /usr/sbin/dnsmasq &
|
|
|
|
|
+echo "DNS配置 /etc/dnsmasq.conf已恢复成功"
|
|
|
|
|
|
|
|
-`cp -r $CURRENT_PATH/pdu_dat.db.bak $CURRENT_PATH/pdu_dat.db`
|
|
|
|
|
|
|
+
|
|
|
|
|
+# 恢复IP配置
|
|
|
|
|
+# 配置文件路径
|
|
|
|
|
+IP_CONFIG_FILE="/etc/network/interfaces"
|
|
|
|
|
+
|
|
|
|
|
+# 恢复IP配置
|
|
|
|
|
+echo "正在恢复IP配置..."
|
|
|
|
|
+cat > "$IP_CONFIG_FILE" << EOF
|
|
|
|
|
+auto lo
|
|
|
|
|
+iface lo inet loopback
|
|
|
|
|
+
|
|
|
|
|
+auto eth0
|
|
|
|
|
+iface eth0 inet static
|
|
|
|
|
+ address 192.168.1.132
|
|
|
|
|
+ netmask 255.255.255.0
|
|
|
|
|
+ gateway 192.168.1.1
|
|
|
|
|
+
|
|
|
|
|
+iface eth0 inet6 static
|
|
|
|
|
+ address fe80::132
|
|
|
|
|
+ netmask 64
|
|
|
|
|
+ gateway fe80::1
|
|
|
|
|
+
|
|
|
|
|
+auto eth1
|
|
|
|
|
+iface eth1 inet dhcp
|
|
|
|
|
+pre-up /etc/network/nfs_check
|
|
|
|
|
+wait-delay 5
|
|
|
|
|
+hostname \$(hostname)
|
|
|
|
|
+EOF
|
|
|
|
|
+
|
|
|
|
|
+echo "IP配置 /etc/network/interfaces已恢复成功"
|
|
|
|
|
|
|
|
|
|
|
|
|
reboot
|
|
reboot
|