#!/bin/sh # # portsnap # # 2013.3.29(Fri) # by ÁÁÀºÁøÈ£(truefeel, http://coffeenix.net/ ) IDX="/usr/ports/.portsnap.INDEX" OSTYPE=`uname` PATH=$PATH:/usr/sbin:/usr/local/bin INST=192.168.123.141 METHOD="rsync" GREEN() { echo -e "\\033[1;32m$*\\033[0m" } # if [ "$OSTYPE" != "FreeBSD" ]; then GREEN "* FreeBSD¿¡¼­¸¸ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù." exit fi # -------------------------------------------------- # rsync or fetch if [ $METHOD == "rsync" ]; then cd /var/db/portsnap rsync -av --delete $INST::portsnap/ . else portsnap fetch fi if [ ! -f $IDX ]; then # first GREEN "* extract" portsnap extract else # update GREEN "* update" portsnap update fi