Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dsys/comINSTALL

    r3 r1  
    340340    #---------------------------------------------------------------------
    341341
    342     instlock="${yule_conf}.lockdir";
    343     trap "rm -rf ${instlock}" 1 2 13 15
    344 
    345     if test x"$simulate" = x0
    346     then
    347         #
    348         # A lockfile will not work, because 'root' can write anyway.
    349         # However, 'mkdir' an existing directory will fail even for root
    350         #
    351         until (umask 222; mkdir "${instlock}") 2>/dev/null   # test & set
    352         do
    353            printINFO "Waiting for lock"
    354            sleep 1
    355         done
    356     fi
    357 
    358342    Replace=`"${yule_exec}" -P "${is_passwd}" | sed s%HOSTNAME%${host}%g`
    359343    if test "x$Replace" = x
    360344    then
    361         rm -rf "${instlock}"
    362345        printFATAL "Could not execute ${yule_exec} -P ${is_passwd}."
    363346    fi
     
    373356            then
    374357                Seen=y
    375                 echo "$Replace" >>"$tmpF"
    376                 if [ $? -ne 0 ]; then
    377                         rm -rf "${instlock}"
    378                         printFATAL "Cannot write new server configuration."
    379                 fi
     358                echo "$Replace" >>"$tmpF" || printFATAL "Cannot write new server configuration."
    380359            fi
    381360        else
     
    384363                :
    385364            else
    386                 echo "$line" >>"$tmpF"
    387                 if [ $? -ne 0 ]; then
    388                         rm -rf "${instlock}"
    389                         printFATAL "Cannot write new server configuration."
    390                 fi
     365                echo "$line" >>"$tmpF" || printFATAL "Cannot write new server configuration."
    391366            fi
    392367        fi
     
    405380    if test x"$simulate" = x0
    406381    then
    407         ageFILE "${yule_conf}"
    408         if [ $? -ne 0 ]; then
    409                 rm -rf "${instlock}"
    410                 printFATAL "Could not backup ${yule_conf}"
    411         fi
    412 
    413         rm -f "${yule_conf}" && cp "$tmpF"  "${yule_conf}"
    414         if [ $? -ne 0 ]; then
    415                 rm -rf "${instlock}"
    416                 printFATAL "Could not write new server config. Backup is ${yule_conf}.1"
    417         fi
    418 
    419         chown ${rcfile_owner}:${rcfile_group} "${yule_conf}"
    420         if [ $? -ne 0 ]; then
    421                 rm -rf "${instlock}"
    422                 printFATAL "Could not chown ${rcfile_owner}:${rcfile_group} ${yule_conf}"
    423         fi
    424 
    425         chmod ${rcfile_perm} "${yule_conf}"
    426         if [ $? -ne 0 ]; then
    427                 rm -rf "${instlock}"
    428                 printFATAL "Could not chmod ${rcfile_perm} ${yule_conf}"
    429         fi
     382        ageFILE "${yule_conf}" || printFATAL "Could not backup ${yule_conf}."
     383        rm -f "${yule_conf}" && { cp "$tmpF"  "${yule_conf}" || printFATAL "Could not write new server config. Backup is ${yule_conf}.1"; }
     384        chown ${rcfile_owner}:${rcfile_group} "${yule_conf}" || printFATAL "Could not chown ${rcfile_owner}:${rcfile_group} ${yule_conf}"
     385        chmod ${rcfile_perm} "${yule_conf}" || printFATAL "Could not chmod ${rcfile_perm} ${yule_conf}"
    430386    else
    431387        printINFO "Backup and update ${yule_conf}"
     
    467423        sleep 5
    468424        #
    469         rm -rf "${instlock}"
    470425    else
    471426        printINFO "Reloading server configuration."
     
    473428
    474429    printLOG "Server configuration updated and reloaded."
    475 
    476430
    477431    #---------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.