Changeset 429 for branches


Ignore:
Timestamp:
09/28/2009 23:25:40 (3 years ago)
Author:
blee
Message:

Merge from trunk various fixes and improvements for libexec utilities.

Fixes #64, #65, #69, #70

Location:
branches/confman-1.9
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/confman-1.9

  • branches/confman-1.9/confaudit.8

    r404 r429  
    3333.Sh SYNOPSIS 
    3434.Nm 
     35.Op Fl s 
    3536.Op Fl q 
    36 .Op Fl s 
     37.Op Fl d 
    3738.Nm 
    3839.Fl h 
     
    4748is intended to be invoked via 
    4849.Xr cron 8 .  
    49 When invoked with 
    50 .Fl q , 
    51 .Nm 
    52 will report only whether files differ and not the actual differences (See 
    53 .Xr diff 1) . 
    54 .Fl h  
    55 will cause 
    56 .Nm 
    57 to display the usage statement and exit. 
    5850.Pp 
    5951The 
     
    6759.Nm 
    6860across multiple managed hosts. 
     61.Pp 
     62When invoked with 
     63.Fl q , 
     64.Nm 
     65will report only whether files differ and not the actual differences (See 
     66.Xr diff 1) . 
     67.Pp 
     68The 
     69.Fl d 
     70option can be used to print additional debugging information. 
     71.Pp 
     72When launched with 
     73.Fl h , 
     74.Nm 
     75will display the usage statement and exit. 
    6976.Pp 
    7077.Nm 
  • branches/confman-1.9/confaudit.in

    r404 r429  
    3232else 
    3333    echo "Can't find confmancommon.sh. Exiting." >&2 
     34    exit 1 
    3435fi 
    3536 
    3637function print_help { 
    37     echo "usage: $0 [-d] [-q]" >&4 
     38    echo "usage: $0 [-s] [-q] [-d]" >&4 
     39    echo "Type '$0 -h' to display this help and exit." >&4 
    3840    exit ${1:-0} 
    3941} 
     
    4143quiet=false 
    4244sleep_mode=false 
    43 while getopts "dqsh" opt 2>&4 ; do 
     45while getopts "sqdh" opt 2>&4 ; do 
    4446    case $opt in  
     47        s) sleep_mode=true ;; 
     48        q) quiet=true ;; 
    4549        d) DEBUG=true ;; 
    46         q) quiet=true ;; 
    47         s) sleep_mode=true ;; 
    4850        h) print_help 0 ;; 
    4951        *) print_help 1 ;; 
  • branches/confman-1.9/confexport.8

    r363 r429  
    3333.Sh SYNOPSIS 
    3434.Nm 
     35.Op Fl d 
    3536.Nm 
    3637.Fl h 
     
    4445repository for use by hosts running 
    4546.Xr confsync 8 . 
     47.Pp 
     48The 
     49.Fl d 
     50option can be used to print additional debugging information. 
    4651.Pp 
    4752When launched with 
  • branches/confman-1.9/confexport.in

    r421 r429  
    4444 
    4545function print_help { 
    46     echo "usage: $0 [-d]">&4 
     46    echo "usage: $0 [-d]" >&4 
     47    echo "Type '$0 -h' to display this help and exit." >&4 
    4748    exit ${1:-0} 
    4849} 
    4950 
    50 while getopts "hd" OPT 2>&4 ; do 
     51while getopts "dh" OPT 2>&4 ; do 
    5152    case "$OPT" in 
    5253        d)  DEBUG=true ;; 
  • branches/confman-1.9/confsync.8

    r404 r429  
    3333.Sh SYNOPSIS 
    3434.Nm 
     35.Op Fl f 
    3536.Op Fl s 
     37.Op Fl d 
    3638.Nm 
    3739.Fl h 
     
    4749operation without the overhead of a working copy. 
    4850.Pp 
     51If the system is already up to date, 
     52.Nm 
     53will exit without making any changes.  This behavior can be overridden with 
     54the 
     55.Fl f 
     56option, which will force 
     57.Nm 
     58to run even if the system revision equals the tar revision.  This is useful 
     59when files are known to have been modified on the live filesystem.  Note that 
     60the 
     61.Fl f 
     62option cannot be used to sync a tar revision less than the system revision. 
     63.Pp 
    4964The 
    5065.Fl s 
     
    5772.Nm 
    5873across multiple managed hosts. 
     74.Pp 
     75The 
     76.Fl d 
     77option can be used to print additional debugging information. 
    5978.Pp 
    6079When launched with 
  • branches/confman-1.9/confsync.in

    r404 r429  
    3535else 
    3636    echo "Can't find confmancommon.sh. Exiting." >&2 
     37    exit 1 
    3738fi 
    3839 
    3940function print_help { 
    40     echo "usage: $0 [-d]" >&4 
     41    echo "usage: $0 [-f] [-s] [-d]" >&4 
     42    echo "Type '$0 -h' to display this help and exit." >&4 
    4143    exit ${1:-0} 
    4244} 
    4345 
     46FORCE=false 
    4447sleep_mode=false 
    45 while getopts "hsd" OPT 2>&4 ; do 
     48while getopts "fsdh" OPT 2>&4 ; do 
    4649    case $OPT in 
     50        f)  FORCE=true ;; 
     51        s)  sleep_mode=true ;; 
    4752        d)  DEBUG=true ;; 
    48         s)  sleep_mode=true ;; 
    4953        h)  print_help 0;; 
    5054        *)  print_help 1;; 
     
    115119    echo "Error: $tarpath is out of date. Exiting without making changes." >&2 
    116120    conf_markdirty 
    117     rm -rf $tmpdir 
    118     exit 1 
     121    conf_cleanExit 1 
    119122fi 
    120123 
    121 if [ -n "$sys_revision" ] && [ $tar_revision -le $sys_revision ] ; then 
    122     echo "System is up to date." | conf_logger 
    123     conf_unlock_system 
    124     rm -rf $tmpdir 
    125     trap EXIT 
    126     exit 0 
     124if [ -n "$sys_revision" ] ; then 
     125    if $FORCE && [ $tar_revision -lt $sys_revision ] ; then 
     126        echo "Error: $tarpath is out of date. Exiting without making changes." >&2 
     127        conf_cleanExit 1 
     128    elif ! $FORCE && [ $tar_revision -le $sys_revision ] ; then 
     129        echo "System is up to date." | conf_logger 
     130        conf_cleanExit 0 
     131    fi 
    127132fi 
    128133 
Note: See TracChangeset for help on using the changeset viewer.