Changeset 10916 in hybrid for branches/releng-9.0/nanobsd


Ignore:
Timestamp:
May 19, 2012, 4:28:15 PM (13 years ago)
Author:
rick
Message:

Make dryrun default as I always forget the type the command.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/releng-9.0/nanobsd/files/tools/sync-etc-changes-to-cf

    r10600 r10916  
    1414  -v     - Verbose diffs
    1515Arguments:
    16   dryrun - Check the pending changes
     16  dryrun - Check the pending changes [default]
    1717  sync   - Sync the pending changes
    1818EOF
     
    2020}
    2121
     22SYNC=false
    2223while [ -n "$1" ]; do
    2324  case "$1" in
     
    3132      SYNC=true; shift
    3233      ;;
     34    "-h")
     35      usage; exit 0;;
    3336    *)
    3437      echo "Invalid Argument -- $1"
     
    3740   esac
    3841done
    39 [ -z "$SYNC" ] && usage
    4042
    41 trap "umount /cfg; mount -ur /" 1 2 15 EXIT
    42 mount -r /cfg
    43 $SYNC && mount -uwo noatime /
     43# To sync we need to now the content of /cfg
     44mount -r /cfg || exit 1
    4445
     46# Leave disks in consistent state on exit
     47trap "umount /cfg; mount -ur /"
     48trap "exit 1" 1 2 15
     49
     50$SYNC && mount -uwo noatime / || exit 1
    4551for file in `find /conf/base/etc -type f`; do
    4652  live_file=${file##/conf/base}
     
    5662done
    5763
    58 umount /cfg
    59 mount -ur /
    60 trap 1 2 15 EXIT
     64if ! $SYNC; then
     65  echo "# Dryrun done, commit changes by calling: $0 sync"
     66fi
Note: See TracChangeset for help on using the changeset viewer.