{"id":198148,"date":"2013-10-21T13:11:03","date_gmt":"2013-10-21T09:11:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=198148"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=198148","title":{"rendered":"<span class=\"post_title\">\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 FreeBSD<\/span>"},"content":{"rendered":"<div class=\"content html_format\">\n<h4>\u0414\u043e\u0431\u0440\u044b\u0439 \u0447\u0430\u0441, \u0425\u0430\u0431\u0440\u043e\u0432\u0447\u0430\u043d\u0435!<\/h4>\n<p>  \u0425\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 FreeBSD \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e sh (bash). \u0414\u0435\u043b\u043e \u0431\u044b\u043b\u043e \u0442\u0430\u043a:<br \/>  \u041e\u0434\u043d\u0430\u0436\u0434\u044b \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u043d\u0430 FreeBSD. \u041f\u043e\u0441\u0442\u0430\u0432\u0438\u0432 \u043e\u0434\u043d\u0443, \u0441\u043b\u0435\u0434\u043e\u043c \u0437\u0430 \u043d\u0435\u0439 \u0432\u0442\u043e\u0440\u0443\u044e \u0438 \u0442\u0440\u0435\u0442\u044c\u044e \u043e\u0441\u044c, \u043c\u044b \u0441 \u043a\u043e\u043b\u043b\u0435\u0433\u043e\u0439 (\u0432 \u0448\u0442\u0430\u0442\u0435 \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0430 \u0430\u0439\u0442\u0438\u0448\u043d\u0438\u043a\u0430) \u0437\u0430\u0434\u0443\u043c\u0430\u043b\u0438\u0441\u044c \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043f\u0443\u0442\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0435\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0441\u0432\u0435\u0436\u0435\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u041e\u0421. \u0417\u0430\u0434\u0430\u0447\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043b\u0435\u0433\u043b\u0430 \u043d\u0430 \u043c\u043e\u0438 \u043f\u043b\u0435\u0447\u0438. \u041a\u043e\u043b\u043b\u0435\u0433\u0430 \u0437\u0430\u043d\u044f\u043b\u0441\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438, \u043e \u0447\u0435\u043c \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043f\u043e\u0441\u0442\u0435. \u0418\u0442\u0430\u043a, \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c!<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0421\u0440\u0430\u0437\u0443 \u0443\u0442\u043e\u0447\u043d\u044e: \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0438\u0441\u0430\u043b\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0441\u0435\u0431\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u043e\u0434 \u043d\u0435 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d \u0434\u043e\u043b\u0436\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u00ab\u043d\u0435 \u0438\u0434\u0435\u0430\u043b\u0435\u043d\u00bb. \u041d\u043e, \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442!<br \/>  \u0421\u043a\u0440\u0438\u043f\u0442 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 3 \u0444\u0430\u0439\u043b\u043e\u0432: \u0444\u0430\u0439\u043b-\u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a, \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u0438 \u0444\u0430\u0439\u043b \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438. \u041d\u0430\u0447\u043d\u0443 \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443.<\/p>\n<h5>loader.sh<\/h5>\n<p>  <\/p>\n<pre><code class=\"bash\">#!\/bin\/sh  lib1='parser.sh'\t\t\t\t\t#CORE FILE lib2='parserlib.sh'\t\t\t\t\t#LIB FILE  #Defining variables --begin--  FTPServer='ftp:\/\/10.10.10.50'\t\t\t#FTP server address FileName='tarball.tar.gz'\t\t\t#Default tarball name LongVersion=`uname -r`\t\t\t\t#Long name of current OS version ShortVersion=${LongVersion%%-*}\t\t\t#Calculatig short version of OS, like &quot;8.3&quot; (DON'T TOUCH THIS LINE, please!) LocalDirectory='\/tmp\/script\/'\t\t\t#Temporary directory. You can manualy clean it later. If it's not exist - just relax, script will create it for you :-) DataDirectory='\/var\/parser-md5-list\/'\t\t#Directory with datafiles LockFile='EditLocker.p'\t\t\t\t#Lock file. Needed to prevent changes in files by script after manual editing. EditLock=&quot;$DataDirectory$LockFile&quot;\t\t#Absolute LockFile path forcer='-no-force'\t\t\t\t#Variable must be not empty in case if -f key was not specified  #Defining variables --end--  usage (){ echo &quot;Only acceptable options: -f to force rebuild without check -s to force execution without restart -d to delete locker file (needed if files was edited manyally or by system, but now you want to rebuild it) -v &lt;version&gt; to manually specify FreeBSD version. Please be sure to specify it correctly! Example: .\/loader.sh -v 9.1 &quot; }   #Defining options --begin--  if [ $# -ge 1 ]  then \twhile getopts fsdv: opt; do \t\tcase &quot;$opt&quot; in \t\t\tf) forcer='-f';; \t\t\ts) skip='-s';; \t\t\td) DL='-d';; \t\t\tv) ShortVersion=&quot;$OPTARG&quot;;; \t\t\t[?]) usage; exit 1;;  \t\tesac \tdone fi  #Defining options --end--  echo &quot;FreeBSD configuration tool V 1.0&quot; echo &quot;Detected OS version: $LongVersion&quot; echo &quot;Applying tarball for version $ShortVersion&quot; echo; echo &quot;Downloading files...&quot; if [ &quot;$DL&quot; == &quot;-d&quot; ] \tthen \t\ttouch $EditLock \t\t#If file does not exists - this line will create it (needed to avoid error message from rm) \t\trm $EditLock\t\t\t#Remove Lock file fi if ! [ &quot;$skip&quot; == &quot;-s&quot; ]  then \tif ! [ -e run.sh ] \t then \t\tfetch &quot;$FTPServer\/FreeBSD\/loader.sh&quot; \t\ttouch run.sh \t\techo &quot;#!\/bin\/sh clear echo \\&quot;*********************************************** * Loader file was updated. Process restarted. * *********************************************** \\&quot; &quot; &gt;&gt; run.sh \t\techo &quot;.\/loader.sh $@&quot; &gt;&gt; run.sh \t\tchmod +x run.sh \t        .\/run.sh \t\texit 1 \t else \t\trm run.sh \tfi fi fetch &quot;$FTPServer\/FreeBSD\/$lib1&quot; fetch &quot;$FTPServer\/FreeBSD\/$lib2&quot; chmod +x $lib1 chmod +x $lib2 . $lib1\t\t\t\t\t\t\t#Attaching core file to process if [ $? -ne 0 ]\t\t\t\t\t\t#Checking for errors then echo &quot;ERROR! Library $lib1 not found!&quot;\t\t#Core file does not exist. exit 1 fi  LetItGo $FTPServer $FileName $ShortVersion $LocalDirectory $forcer $DataDirectory $EditLock <\/code><\/pre>\n<h5>parser.sh<\/h5>\n<p>  <\/p>\n<pre><code class=\"bash\">#!\/bin\/sh -x  LetItGo()\t\t\t#Body of script { lib1='parserlib.sh'\t\t\t\t\t#Lib file . $lib1\t\t\t\t\t\t\t#Attaching lib file to process if [ $? -ne 0 ]\t\t\t\t\t\t#Checking for errors then echo &quot;ERROR! Library $lib1 not found!&quot;\t\t#Lib file does not exist. \tkill $$ \texit 1 fi  #Defining variables --begin--  server=$1\t\t\t#FTP server address file=$2\t\t\t\t#Default tarball name ver=$3\t\t\t\t#Version of OS, like &quot;8.3&quot; LocalDir=$4\t\t\t#Temporary directory. You can manually clean it later. If it's not exist - just relax, script will create it for you :-) DataDirectory=$6\t\t#Directory with data files EditLock=$7\t\t\t#This file needed to prevent overriding for manually edited files.  #Defining variables --end--  cdOrCreate $DataDirectory\t\t\t\t#Creating data directory if not exists cdOrCreate $LocalDir\t\t\t\t\t#Enter temporary directory for file downloads dirchek=`pwd`\/ if [ &quot;$dirchek&quot; == &quot;$LocalDir&quot; ]\t\t\t#Checking current directory  then \trm -rf *\t\t\t\t\t\t#If script successfully entered the temp directory - it will be cleaned  else \techo &quot;$LocalDir is not accesible! Please check permissions!&quot; \tkill $$ \texit 1 fi  fetch &quot;$server\/FreeBSD\/$ver\/$file&quot;\t\t\t#Download tarball hshchk=$(md5 $file) HashCheck ${hshchk##* } $LocalDir $file $5 $DataDirectory cd $LocalDir echo &quot;Extracting files&quot; tar -zxf $file\t\t\t\t\t\t#Unpack it echo &quot;DONE! &quot;  rm $file\t\t\t\t\t\t#Remove tarball echo &quot;Tarball was removed from local server.&quot; touch $EditLock echo &quot;Lockfile created: $EditLock&quot; for f in $( find $LocalDir ); do\t\t\t#Proceed all files one by one if [ -f $f ]  then \t\t\t\t\t\t\t\t#check file for manual changes \tNEWFILE=${f#$LocalDir} \tNEWFILE=\/${NEWFILE#*\/} \tHCK=$(md5 $f) \tHCK=${HCK##* } \t#TIMEEDIT=&quot;$NEWFILE `stat -f %Sm -t %Y%m%d%H%M%S &quot;$NEWFILE&quot;`&quot; \tEDITC=&quot;$NEWFILE $HCK&quot; \tCHECK=`grep &quot;$EDITC&quot; &quot;$EditLock&quot;` \tSIMPLECHECK=`grep &quot;$NEWFILE&quot; &quot;$EditLock&quot;`  #You may add your own subtree in additional elif below (for example: immediately script execution, assigning permissions, e.t.c.)  \tif [ &quot;`expr &quot;$f&quot; : '.*\\(\/Merge\/\\)'`&quot; == &quot;\/Merge\/&quot; ]\t\t#If file should be merged \t then \t\tTempPath=${f##*\/Merge}\t\t\t\t\t#Cut filepath. Original location will remain \t\techo; echo &quot;Merge: $f --&gt; $TempPath&quot; \t\tif ! [ -f $TempPath ]\t\t\t\t\t#If original file exist \t\t then \t\t\tMoveToLocal $f Merge\t\t\t\t#Then just replace it by new one \t\t else \t\t\tMergeFiles $f $TempPath\t\t\t\t#Else - merge new file to the old one line by line \t\t\tsort -u $TempPath &gt; $TempPath.tmp\t\t\t#Delete repeating lines if exists \t\t\tmv -f $TempPath.tmp $TempPath\t\t\t#Rewriting merged file by filtered unique data \t\t\tCleanEOL $TempPath\t\t\t\t\t#Cleaning empty lines \t\tfi \t\techo &quot;DONE!&quot; \t elif [ &quot;`expr &quot;$f&quot; : '.*\\(\/Replace\/\\)'`&quot; == &quot;\/Replace\/&quot; ]\t\t#If file should be replaced \t\tthen \t\t\tif [ &quot;$EDITC&quot; == &quot;$CHECK&quot; ] || [ &quot;$SIMPLECHECK&quot; = '' ] \t\t\t then \t\t\t\techo; echo &quot;Replace: $f --&gt; ${f##*\/Replace}&quot; \t\t\t\tMoveToLocal $f Replace\t\t\t\t\t#Then just replace it \t\t\t\techo &quot;DONE!&quot; \t\t\t\techo &quot;$EDITC&quot; &gt;&gt; $EditLock \t\t\t\tsort -u $EditLock &gt; $EditLock.tmp       \t\t#Delete repeating lines if exists \t\t\t\tmv -f $EditLock.tmp $EditLock \t\t\t else \t\t\t\techo; echo &quot;File $NEWFILE was edited manually. Skipped. Use -d key to ignore it.&quot; \t\t\tfi \t elif [ &quot;`expr &quot;$f&quot; : '.*\\(\/Scripts\/\\)'`&quot; == &quot;\/Scripts\/&quot; ]\t\t#If tarball contains a scripts, which should have +x permissions \t\tthen \t\t\techo; echo &quot;Replace script: $f --&gt; ${f##*\/Scripts}&quot; \t\t\tMoveToLocal $f Scripts\t\t\t\t\t#Then replace it (scripts cannot be merged) \t\t\tchmod +x ${f##*\/Scripts}\t\t\t\t\t#And give eXecution permissions \t\t\techo &quot;DONE!&quot; \t else \t\t\techo; echo &quot;DON'T match. Cannot proceed $f. Skipping.&quot;\t#This message means there is another subtree in tarball. It should be removed or described here \tfi fi done echo; echo &quot;====================================================================&quot; echo; echo &quot;Cleaning temporary files&quot; cd $LocalDir dirchek=`pwd`\/ if [ &quot;$dirchek&quot; == &quot;$LocalDir&quot; ]     \t                   \t#Checking current directory  then \trm -rf * \techo &quot;Succesfully cleaned&quot;  else \techo &quot;Temporary files was NOT deleted!&quot;  fi echo &quot;DONE!&quot; echo &quot; Tarball was successfully applied.&quot; echo &quot;To re-apply it again - use force key (-f).&quot;\t\t#Finished } <\/code><\/pre>\n<p>  \u0418, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0444\u0443\u043d\u043a\u0446\u0438\u0438:  <\/p>\n<h5>parserlib.sh<\/h5>\n<p>  <\/p>\n<pre><code class=\"bash\">#!\/bin\/sh -x  cdOrCreate()\t\t\t\t#Enter the directory. Create if it's not exist, then enter. Arguments: 1) Path to directory (alternate or absolute). {  \tif ! [ -d $1 ]\t\t\t#If directory does not exists \t then mkdir -p &quot;$1&quot;\t#Then create it \tfi \tcd &quot;$1&quot;\t\t\t\t#Enter the directory }  MoveToLocal()\t#Create path and move file there (or replace existing file). Arguments: 1) full filename with full filepath 2) Folder identifyer, without slashes. { \tTempPath=${1##*\/$2}\t\t\t\t#Deleting folder identifier from path \tAbsolutePath=${TempPath%\/*}\t\t\t#Completing absolute path \tcdOrCreate $AbsolutePath\t\t\t#See cdOrCreate() description \tcd ${1%\/*}&quot;\/&quot;\t\t\t\t#Entering directory with file for move \tmv ${1##*\/} $AbsolutePath&quot;\/&quot;${1##*\/}\t#Move file to new (absolute path) location }   MergeFiles()\t\t#Using for check each file from &quot;Merge&quot; subtree and replace lines, or add line to end of file if not exist (?). Files MUST BE in conf syntax.  { \tcat $1 | while read line \tdo \t lineName=${line%=*}\t\t\t\t\t#Calculating key name \t lineName=&quot;$lineName=&quot;\t \t lineHashedName=${lineName##\\#}\t\t\t\t#Calculating name if commented \t sed -i -e 's\/^'$lineHashedName'.*\/'$line'\/g' $2\t\t#Replace line with key (uncommented) \t sed -i -e 's\/^#'$lineHashedName'.*\/'$line'\/g' $2\t\t#Replace line with key (commented by one hash) \t echo &quot;$line&quot; &gt;&gt; $2\t\t\t\t\t\t#Append key to the end of file (dublicates will be sorted). \tdone }  CleanEOL()\t\t#This function needed for delete ^M from end of replaced lines and delete every empty line. Arguments: 1) Filename with path. { \tmv $1 tempconfig.conf \tcat tempconfig.conf | tr -d '\\r' &gt; tempconfig.conf.1\t#Deleting ^M \tgrep '.' tempconfig.conf.1 &gt; $1\t\t\t\t#Deleting empty lines and move file to original location \trm tempconfig.conf*\t\t\t\t\t\t#Deleting temporary files }  HashCheck()\t#Checks MD5 of tarball. Arguments: 1) Filename 2) Path 3) Tarball name 4) Flag (force rebuild existing installation) 5) Data directory { \tcdOrCreate &quot;\/var\/parser-md5-list\/&quot;\t#See cdOrCreate description \tfpath=$5\t\t\t\t\t\t#Location of currently downloaded tarball \tpointcheck=$4\t\t\t\t\t#Force flag. If equal to &quot;-f&quot; then check will be skipped \tif ! [ -f $fpath ]\t\t\t\t\t#If checkfile does not exists \t then \t\ttouch $fpath\t\t\t\t\t#Then create it \t\techo $(date) &gt;&gt; $fpath\t\t\t\t#And write date and time into it \t elif ! [ &quot;$pointcheck&quot; == '-f' ]\t\t\t#If file exists and force flag was not specified \t  then \t\tcat $1 | while read line\t\t\t#Then read date and time from existing file \t\tdo\t\t\t\t\t\t#Show message \t\t echo &quot; ===========================================================&quot; \t\t echo &quot; This tarball was applied at $line &quot; \t\t echo &quot; Use -f (force) to ignore this warning and rebuild anyway &quot; \t\t echo &quot;=========================================================== &quot; \t\t cd &quot;$2&quot;\t\t\t\t\t\t#Enter directory which contains currently downloaded tarball \t\t rm &quot;$3&quot;\t\t\t\t\t\t#And delete tarball \t\t kill $$\t\t\t\t\t\t#Kill parent process and exit \t\t exit 1 \t\tdone \t esle\t\t\t\t\t\t\t#If file exists and -f was specified \t\trm $fpath\t\t\t\t\t#Delete existing file \t\ttouch $fpath\t\t\t\t\t#And create a new one \tfi } <\/code><\/pre>\n<p>  \u041d\u0430 FTP \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0430\u0440\u0445\u0438\u0432\u043e\u0432 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438:<\/p>\n<pre><code class=\"bash\">#!\/bin\/sh cdOrCreate()    #Enter the directory. Create if it's not exist, then enter. Arguments: 1) Path to directory (alternate or absolute). {         if ! [ -d $1 ]          #If directory does not exists          then mkdir &quot;$1&quot;        #Then create it         fi         cd &quot;$1&quot;                 #Enter directory }  cd \/data\/ftproot\/FreeBSD\/ cat list.txt | while read line         do          if [ &quot;$1&quot; == '-v' ]           then                 echo &quot; == Processing subtree for version $line ==&quot;          fi          cdOrCreate $line          rm tarball.tar.gz          if [ &quot;$1&quot; == '-v' ]           then                 tar -zcvf tarball.tar.gz *                 cd ..           else                 tar -zcf tarball.tar.gz *                 cd ..          fi         done echo &quot; DONE!&quot; if ! [ &quot;$1&quot; == '-v' ]         then                 echo &quot;Use -v for detailed output.&quot; fi <\/code><\/pre>\n<p>  \u0412 \u0430\u0440\u0445\u0438\u0432 \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b, \u043b\u0435\u0436\u0430\u0449\u0438\u0435 \u0432 \u043f\u043e\u0434\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 <b>list.txt<\/b>.<br \/>  \u041f\u043e\u0441\u043b\u0435 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u0430\u0440\u0445\u0438\u0432\u0430 \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0432\u0435\u0442\u043a\u0438 Merge \u0438 Replace. \u0414\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u0437\u0430\u043c\u0435\u043d\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0432 \u0444\u0430\u0439\u043b\u0430\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0438\u043b\u0438 \u0440\u0430\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f. \u0414\u043b\u044f \u0432\u0442\u043e\u0440\u043e\u0439 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u0430\u044f \u0437\u0430\u043c\u0435\u043d\u0430 \u0444\u0430\u0439\u043b\u043e\u0432. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0435\u0433\u043e MD5 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 <b>$DataDirectory$LockFile<\/b> \u0438, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u044b\u0445 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u0444\u0430\u0439\u043b\u044b \u0441 \u043d\u0435\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c MD5 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u044b \u043d\u0435 \u0431\u0443\u0434\u0443\u0442. \u042d\u0442\u043e \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043e\u0442\u043a\u0430\u0442\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u0441\u0434\u0435\u043b\u0430\u043d\u043d\u044b\u0445 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u043e\u043c \u0432\u0440\u0443\u0447\u043d\u0443\u044e.<br \/>  \u0422\u0430\u043a\u0436\u0435, \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439 \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 \u0444\u0430\u0439\u043b run.sh \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f, \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0438 \u0443\u0434\u0430\u043b\u044f\u0435\u0442\u0441\u044f. \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u2014 \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043b\u0435\u0433\u043a\u043e \u0432\u044b\u043f\u0438\u043b\u0438\u0442\u044c.<br \/>  \u0421\u043a\u0440\u0438\u043f\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043b\u044e\u0447\u0438 (\u0432 \u043b\u044e\u0431\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435):<br \/>  <b>-f<\/b> \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0430\u0440\u0445\u0438\u0432\u0430<br \/>  <b>-s<\/b> \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a \u0441\u043a\u0440\u0438\u043f\u0442\u0430<br \/>  <b>-d<\/b> \u0443\u0434\u0430\u043b\u044f\u0435\u0442 lockfile. \u041d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u043e\u0442\u043a\u0430\u0442\u0430 \u0440\u0443\u0447\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439<br \/>  <b>-v VER <\/b> \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0432\u0435\u0440\u0441\u0438\u044e FreeBSD<br \/>  \u041b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u043a\u043b\u044e\u0447 \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e usage \u0438 \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442 \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0442\u0443.<br \/>  \u0422\u0430\u043a\u0436\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u043e\u0434\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439 \u0432 \u0430\u0440\u0445\u0438\u0432\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0438\u0445 \u0432 \u0444\u0430\u0439\u043b\u0435 parser.sh \u0432 \u0432\u0435\u0442\u043a\u0435 elif \u043d\u0438\u0436\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f.<br \/>  \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043c\u043e\u0438\u0445 \u0430\u0440\u0445\u0438\u0432\u043e\u0432 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  Merge\/boot\/loader.conf<br \/>  Merge\/etc\/rc.conf<br \/>  Replace\/usr\/local\/etc<br \/>  Replace\/usr\/local\/etc\/svnup.conf<br \/>  Replace\/usr\/share\/skel<br \/>  Replace\/usr\/share\/skel\/dot.cshrc<br \/>  Replace\/etc\/ntp.conf<br \/>  Replace\/etc\/adduser.conf<br \/>  Replace\/etc\/portsnap.conf<br \/>  Replace\/root\/.cshrc<\/p>\n<p>  \u0413\u0434\u0435 \u043f\u043e\u0441\u043b\u0435 \u0438\u043c\u0435\u043d\u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 (\u0443 \u043c\u0435\u043d\u044f \u044d\u0442\u043e Merge \u0438 Replace) \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443. \u0418\u043c\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0438 \u0432\u0441\u0451 \u0447\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u043e \u043d\u0435\u0433\u043e \u0443\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f, \u0434\u0430\u043b\u0435\u0435 \u0444\u0430\u0439\u043b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u0434\u043e\u043c \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0435\u043c\u0443 \u0432\u0435\u0442\u043a\u0435 if&#8217;\u0430.<br \/>  \u0421\u043a\u0440\u0438\u043f\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u043e\u0434\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0442.\u0435. \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u0441\u0432\u0435\u0436\u0435\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0444\u0440\u044f\u0445\u0435.<br \/>  \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0443\u0436\u043d\u043e \u0441\u0444\u0435\u0442\u0447\u0438\u0442\u044c \u0444\u0430\u0439\u043b loader.sh, \u0434\u0430\u0442\u044c \u0435\u043c\u0443 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 (chmod +x loared.sh) \u0438, \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c.<\/p>\n<p>  \u0411\u0443\u0434\u0443 \u0440\u0430\u0434 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u043a\u0440\u0438\u0442\u0438\u043a\u0435, \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f\u043c \u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c, \u0442.\u043a. \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u0447\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0435 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e, \u0438 \u0441 \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435\u043c \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0435\u0433\u043e.<\/p>\n<p>  <b>P.S.:<\/b> \u041e\u0447\u0435\u043d\u044c \u0438\u0437\u0432\u0438\u043d\u044f\u044e\u0441\u044c \u0437\u0430 \u043d\u0435\u0434\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0441\u0442 \u0432 \u043f\u044f\u0442\u043d\u0438\u0446\u0443. \u0421\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b \u043a\u043e\u043f\u0438\u044e \u0438 \u043d\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u043b \u044d\u0442\u043e\u0433\u043e.    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/198148\/\"> http:\/\/habrahabr.ru\/post\/198148\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">\n<h4>\u0414\u043e\u0431\u0440\u044b\u0439 \u0447\u0430\u0441, \u0425\u0430\u0431\u0440\u043e\u0432\u0447\u0430\u043d\u0435!<\/h4>\n<p>  \u0425\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 FreeBSD \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e sh (bash). \u0414\u0435\u043b\u043e \u0431\u044b\u043b\u043e \u0442\u0430\u043a:<br \/>  \u041e\u0434\u043d\u0430\u0436\u0434\u044b \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u043d\u0430 FreeBSD. \u041f\u043e\u0441\u0442\u0430\u0432\u0438\u0432 \u043e\u0434\u043d\u0443, \u0441\u043b\u0435\u0434\u043e\u043c \u0437\u0430 \u043d\u0435\u0439 \u0432\u0442\u043e\u0440\u0443\u044e \u0438 \u0442\u0440\u0435\u0442\u044c\u044e \u043e\u0441\u044c, \u043c\u044b \u0441 \u043a\u043e\u043b\u043b\u0435\u0433\u043e\u0439 (\u0432 \u0448\u0442\u0430\u0442\u0435 \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0430 \u0430\u0439\u0442\u0438\u0448\u043d\u0438\u043a\u0430) \u0437\u0430\u0434\u0443\u043c\u0430\u043b\u0438\u0441\u044c \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043f\u0443\u0442\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0435\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0441\u0432\u0435\u0436\u0435\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u041e\u0421. \u0417\u0430\u0434\u0430\u0447\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043b\u0435\u0433\u043b\u0430 \u043d\u0430 \u043c\u043e\u0438 \u043f\u043b\u0435\u0447\u0438. \u041a\u043e\u043b\u043b\u0435\u0433\u0430 \u0437\u0430\u043d\u044f\u043b\u0441\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438, \u043e \u0447\u0435\u043c \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043f\u043e\u0441\u0442\u0435. \u0418\u0442\u0430\u043a, \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c!  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-198148","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/198148","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=198148"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/198148\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=198148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=198148"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=198148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}