Changeset 374


Ignore:
Timestamp:
Apr 29, 2012, 12:56:44 PM (13 years ago)
Author:
Rick van der Zwet
Message:

Maintain daemons as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • freebsd-mgnt/update-via-portmaster.sh

    r373 r374  
    2525portsnap fetch update || exit 1
    2626
    27 # Make sure the internal database is consistent
    28 pkgdb -Fa || exit 1
     27# Find out which daemons to stop before the update
     28update_list=`pkg_version -o -L= | xargs -n1 pkg_info -qO`
     29
     30if [ -z "$update_list" ]; then
     31  echo "Everything is up2date"
     32  exit 0
     33fi
     34
     35# Find the rc.d/* entries affected
     36for pkg in $update_list; do
     37  rc_d="$rc_d `pkg_info -qL $pkg $(pkg_info -qR $pkg) | grep -F '/rc.d/'`"
     38done
     39rc_d="`echo $rc_d | xargs -n1 | sort -u`"
     40
     41# Stop the daemons affected
     42for rc in $rc_d; do
     43  $rc stop
     44done
    2945
    3046# Install via portmaster
    3147portmaster -adG
     48
     49# Just to be sure try to start all port daemons again (this will make sure the
     50# already updated ones are also started nicely again).
     51for rc in /usr/local/etc/rc.d/*; do
     52  $rc restart
     53done
Note: See TracChangeset for help on using the changeset viewer.