Changeset 7814c14


Ignore:
Timestamp:
07/31/13 07:53:58 (12 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2
Children:
4f9718b
Parents:
d94e3676
Message:

Add option to set / get options via lpreserver command

Location:
src-sh/lpreserver
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src-sh/lpreserver/backend/functions.sh

    rca25b67 r7814c14  
    1212# Location of settings  
    1313DBDIR="/var/db/lpreserver" 
     14if [ ! -d "$DBDIR" ] ; then mkdir -p ${DBDIR} ; fi 
     15 
    1416LOGDIR="/var/log" 
    1517export DBDIR LOGDIR PROGDIR 
  • src-sh/lpreserver/lpreserver

    rd515a9e r7814c14  
    221221# Check if we need to enable the zfs monitor 
    222222enable_watcher 
    223  
    224 # Check for the database dir 
    225 if [ -d "$DBDIR" ]; mkdir -p "$DBDIR" ; fi 
    226223 
    227224# Check what the user wants to do 
     
    240237 
    241238    get) require_root 
    242  
     239         # Display our options   
     240         title 
     241         echo "      Recursive mode: $RECURMODE" 
     242         echo "E-Mail Notifications: $EMAILMODE" 
     243         echo "    E-Mail Addresses: $EMAILADDY" 
     244         exit 0 
    243245         ;; 
    244246 
     
    247249 
    248250         case $OPT in 
    249             email) case 3 in 
    250                   ALL|WARN|ERROR)  echo "Recursive mode disabled"  
    251                                 touch ${DBDIR}/recursive-off ;; 
    252                      ON|On|on)  echo "Recursive mode enabled"  
    253                                 rm ${DBDIR}/recursive-off 2>/dev/null ;; 
     251        emailopts) case $3 in 
     252                  ALL|WARN|ERROR) echo "E-Mail mode set to: $3"  
     253                                  echo "$3" > ${DBDIR}/emaillevel ;; 
    254254                     *) exit_err "Unknown option" ;; 
    255255                   esac 
    256256                   ;; 
    257         emailopts) rm "${JMETADIR}/vnet" 2>/dev/null ;; 
    258         recursive) case 3 in 
     257            email) echo "Setting email notification to: $3"  
     258                   echo "$3" > ${DBDIR}/emails ;; 
     259        recursive) case $3 in 
    259260                  OFF|Off|off)  echo "Recursive mode disabled"  
    260261                                touch ${DBDIR}/recursive-off ;; 
Note: See TracChangeset for help on using the changeset viewer.