tons of misc updates
[distro-setup] / switch-mail-host
index b3e78325be1ae01d70d25b734cf991d5dbad86d7..b67203aabc475608a4768cbcc2204126979ef48b 100755 (executable)
@@ -133,9 +133,10 @@ if [[ $new_host == $HOSTNAME ]] && ! $at_home; then
     echo | $wrt_shell cedit mail_host /etc/hosts || [[ $? == 1 ]] # 1 means file changed.
 else
     $wrt_shell bash -s <<EOFOUTER
-    cedit mail_host /etc/hosts <<EOF || /etc/init.d/dnsmasq restart
+    if ! cedit mail_host /etc/hosts <<EOF; then
 \$(grep "\b$new_host\b" /etc/hosts | awk '{print \$1}') mail.iankelling.org
 EOF
+/etc/init.d/dnsmasq restart
 EOFOUTER
 fi