Index: branches/releng-9.0/nanobsd/files/tools/sync-etc-changes-to-cf
===================================================================
--- branches/releng-9.0/nanobsd/files/tools/sync-etc-changes-to-cf	(revision 10914)
+++ branches/releng-9.0/nanobsd/files/tools/sync-etc-changes-to-cf	(revision 10916)
@@ -14,5 +14,5 @@
   -v     - Verbose diffs
 Arguments:
-  dryrun - Check the pending changes
+  dryrun - Check the pending changes [default]
   sync   - Sync the pending changes
 EOF
@@ -20,4 +20,5 @@
 }
 
+SYNC=false
 while [ -n "$1" ]; do
   case "$1" in
@@ -31,4 +32,6 @@
       SYNC=true; shift
       ;;
+    "-h")
+      usage; exit 0;;
     *)
       echo "Invalid Argument -- $1"
@@ -37,10 +40,13 @@
    esac
 done
-[ -z "$SYNC" ] && usage
 
-trap "umount /cfg; mount -ur /" 1 2 15 EXIT
-mount -r /cfg
-$SYNC && mount -uwo noatime /
+# To sync we need to now the content of /cfg
+mount -r /cfg || exit 1
 
+# Leave disks in consistent state on exit
+trap "umount /cfg; mount -ur /"
+trap "exit 1" 1 2 15
+
+$SYNC && mount -uwo noatime / || exit 1
 for file in `find /conf/base/etc -type f`; do
   live_file=${file##/conf/base}
@@ -56,5 +62,5 @@
 done
 
-umount /cfg
-mount -ur /
-trap 1 2 15 EXIT
+if ! $SYNC; then
+  echo "# Dryrun done, commit changes by calling: $0 sync"
+fi
