Changeset 375
- Timestamp:
- Apr 29, 2012, 2:48:42 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
freebsd-mgnt/update-via-portmaster.sh
r374 r375 25 25 portsnap fetch update || exit 1 26 26 27 # Find out which daemons to stop before the update 27 echo "# Find out which packages to update" 28 28 update_list=`pkg_version -o -L= | xargs -n1 pkg_info -qO` 29 29 … … 33 33 fi 34 34 35 # Find the rc.d/* entries affected 35 echo "# Find the rc.d/* entries affected" 36 36 for pkg in $update_list; do 37 37 rc_d="$rc_d `pkg_info -qL $pkg $(pkg_info -qR $pkg) | grep -F '/rc.d/'`" 38 38 done 39 39 rc_d="`echo $rc_d | xargs -n1 | sort -u`" 40 41 echo "# Going to update the following packages:" 42 echo $update_list | xargs -n1 echo "# - " 43 echo "# The following daemons will not be available:" 44 for rc in $rc_d; do 45 echo "# - $rc (`$rc status 2>&1 | grep -v -e '^Usage:' -e 'directive' -e '^Cannot'`)" 46 done 47 echo -n "# Do you like to update the packages: (y|n) [y]: "; read INPUT 48 case $INPUT in 49 ''|y) ;; 50 [yY][eE][sS]) ;; 51 *) 52 echo "Canceled by user!"; exit 1 53 ;; 54 esac 40 55 41 56 # Stop the daemons affected … … 45 60 46 61 # Install via portmaster 47 portmaster - adG62 portmaster --no-confirm -yadG 48 63 49 64 # Just to be sure try to start all port daemons again (this will make sure the 50 65 # already updated ones are also started nicely again). 51 for rc in /usr/local/etc/rc.d/*; do66 for rc in `rcorder /usr/local/etc/rc.d/* 2>/dev/null`; do 52 67 $rc restart 53 68 done
Note:
See TracChangeset
for help on using the changeset viewer.