diff options
author | B Stack <bgstack15@gmail.com> | 2017-02-06 11:32:49 -0500 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2017-02-06 11:32:49 -0500 |
commit | 148eabc90916215324ec11426baf7001d62f0db7 (patch) | |
tree | 4462031fe55b8d50c64c7a4cbe3d2c7cea9fccbf | |
parent | fixed ./pack with new location (diff) | |
download | mirror-148eabc90916215324ec11426baf7001d62f0db7.tar.gz mirror-148eabc90916215324ec11426baf7001d62f0db7.tar.bz2 mirror-148eabc90916215324ec11426baf7001d62f0db7.zip |
added --noupdate to deploy.sh
-rwxr-xr-x | usr/share/mirror/deploy.sh | 32 | ||||
-rw-r--r-- | usr/share/mirror/docs/README.txt | 9 |
2 files changed, 26 insertions, 15 deletions
diff --git a/usr/share/mirror/deploy.sh b/usr/share/mirror/deploy.sh index 2a03abc..0adb090 100755 --- a/usr/share/mirror/deploy.sh +++ b/usr/share/mirror/deploy.sh @@ -6,6 +6,7 @@ # Purpose: To make it easy to deploy to the mirror a new version of a package # Package: mirror # History: +# 2017-02-06 added --noupdate option # Usage: # Reference: ftemplate.sh 2016-07-12a; framework.sh 2016-05-25a # mirror-master from mirror-1.0-2.noarch.rpm @@ -17,7 +18,7 @@ deployversion="2016-07-14a" usage() { less -F >&2 <<ENDUSAGE -usage: deploy.sh [-duV] [-c conffile] packagename packageversion +usage: deploy.sh [-duV] [-c conffile] [-n] packagename packageversion version ${deployversion} -d debug Show debugging info, including parsed variables. -u usage Show this usage block. @@ -26,6 +27,7 @@ version ${deployversion} Given a packagename and packageversion, this script will deploy the correct architecture type of package file to the specified locations. If debug level is 3 or less, the copy will actually be performed. See the conffile ${conffile} for examples. + -n noupdate Do not execute the update script. Useful for serial deployments. Return values: 0 Normal 1 Help or version info displayed @@ -90,6 +92,7 @@ function parseFlag { "V" | "fcheck" | "version" ) ferror "${scriptfile} version ${deployversion}"; exit 1;; #"i" | "infile" | "inputfile" ) getval;infile1=$tempval;; "c" | "conffile" ) getval;conffile=$tempval;; + "n" | "noupdate" ) noupdate=1;; esac debuglev 10 && { [[ hasval -eq 1 ]] && ferror "flag: $flag = $tempval" || ferror "flag: $flag"; } @@ -118,6 +121,7 @@ esac conffile=/etc/mirror/deploy.conf logfile=${scriptdir}/${scripttrim}.${today}.out interestedparties="bgstack15@example.com" +noupdate=0 # can be adjusted with a flag # REACT TO ROOT STATUS case $is_root in @@ -278,16 +282,22 @@ do line=$( echo "${line}" | sed -e 's/^\s*//;s/\s*$//;/^[#$]/d;s/\s*[^\]#.*$//;' eval thisupdatescript=\${${thiszone}updatescript} if [[ thiszoneused -ne 0 ]]; then - [[ -n "${thisupdatescript}" ]] && { - if [[ ! -x "${thisupdatescript}" ]]; - then - ferror "Cannot execute the updatescript ${thisupdatescript}. Skipped." - else - # is executable - debuglev 2 && ferror "Execute ${thisupdatescript}" - ! debuglev 4 && ${thisupdatescript} - fi - } + if test "${noupdate}" = "1"; + then + # told to not execute any update scripts at all. + ferror "Skipping any execute scripts." + else + [[ -n "${thisupdatescript}" ]] && { + if [[ ! -x "${thisupdatescript}" ]]; + then + ferror "Cannot execute the updatescript ${thisupdatescript}. Skipped." + else + # is executable + debuglev 2 && ferror "Execute ${thisupdatescript}" + ! debuglev 4 && ${thisupdatescript} + fi + } + fi fi } # end if-not-input-zone diff --git a/usr/share/mirror/docs/README.txt b/usr/share/mirror/docs/README.txt index b7194df..cb768fe 100644 --- a/usr/share/mirror/docs/README.txt +++ b/usr/share/mirror/docs/README.txt @@ -15,9 +15,9 @@ mirror is basically a collection of scripts that provide the sync instructions t ## Steps to take before using mirror for the first time Configure these files: -/etc/httpd/sites/mirror.conf -/etc/mirror/inc/rsync /etc/mirror/mirror.conf +/etc/httpd/sites/mirror.conf +/usr/share/mirror/inc/rsync Select a storage directory. On the EXAMPLE mirror, we used an nfs mount for multiple locations. --- BEGIN excerpt from mirror.example.com:/etc/fstab @@ -36,14 +36,14 @@ chmod +x /etc/mirror/scripts/{centos,fedora-epel,fedora-releases,fedora-updates, ## Configuring the web server Included in this package are some apache configs. -For a nice intro page, a template is provided at /etc/mirror/inc/HEADER.html +For a nice intro page, a template is provided at /usr/share/mirror/inc/HEADER.html ## Maintaining your mirror server Fedora only keeps current the two latest versions. Ubuntu keeps certain versions current: check http://releases.ubuntu.com/ for which versions. ### USAGE BLOCK -usage: mirror-master.sh [-duV] [ -f | --file /etc/mirror/mirror.conf ] [ --scriptsdir /etc/mirror/scripts ] [ scriptname ] +usage: mirror-master.sh [-duV] [ -f | --file /etc/mirror/mirror.conf ] [ --scriptsdir /usr/share/mirror/scripts ] [ scriptname ] version ${mirrormasterversion} -d debug Show debugging info, including parsed variables. -u usage Show this usage block. @@ -89,3 +89,4 @@ Updated all scripts for the bgscripts-1.1-28 directory migration to /usr/share/b 2017-02-06 mirror-1.0-7 Rearranged directory structure to comply with FHS 3.0 Included a zz_proxy.conf example +Added deploy.sh --noupdate option |