Explorar el Código

fixed bash sctip for refresh dnsmasq config

root hace 2 años
padre
commit
22e5df5023
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      scripts/update-dnsmasq

+ 3 - 1
scripts/update-dnsmasq

@@ -28,7 +28,9 @@ if [ -n "${CHANGES}" -o -n "${force}" ]; then
         systemctl stop dnsmasq >/dev/null
         echo "${CHANGES}" | while read LEASE; do
             logger -t dhcpd "Clear ${LEASE}"
-            sed -i "/${LEASE}/d" /var/lib/misc/dnsmasq.leases
+            if [ -n "${LEASE}" ]; then
+                sed -i "/${LEASE}/d" /var/lib/misc/dnsmasq.leases
+                fi
         done
         systemctl start dnsmasq >/dev/null
         else