diff --git a/cdist/conf/type/__install_config/gencode-local b/cdist/conf/type/__install_config/gencode-local
index 4f1dcc23..cbf916da 100755
--- a/cdist/conf/type/__install_config/gencode-local
+++ b/cdist/conf/type/__install_config/gencode-local
@@ -45,7 +45,7 @@ DONE
 
 cat << DONE
 $__remote_exec $__target_host << EOSSH
-if mountpoint -q "${chroot}/etc/resolv.conf";
+if mountpoint -q "${chroot}/etc/resolv.conf"; then
    umount "${chroot}/etc/resolv.conf"
 fi
 if [ -f "${chroot}/etc/resolv.conf" -a ! -s "${chroot}/etc/resolv.conf" ]; then