"Fossies" - the Fresh Open Source Software Archive

Member "ispconfig3_install/server/scripts/update_runner.sh" (8 Jun 2021, 2090 Bytes) of package /linux/privat/ISPConfig-3.2.5.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "update_runner.sh": 3.2.4_vs_3.2.5.

    1 #!/bin/bash
    2 
    3 _UPD=1
    4 
    5 # padding handles script being overwritten during updates
    6 # see https://git.ispconfig.org/ispconfig/ispconfig3/issues/4227
    7 
    8 ##################################################
    9 ##################################################
   10 ##################################################
   11 ##################################################
   12 ##################################################
   13 ##################################################
   14 ##################################################
   15 ##################################################
   16 ##################################################
   17 ##################################################
   18 ##################################################
   19 ##################################################
   20 
   21 SOURCE=$1
   22 URL=""
   23 
   24 if [[ "$SOURCE" == "stable" ]] ; then
   25     URL="https://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz"
   26 elif [[ "$SOURCE" == "nightly" ]] ; then
   27     URL="https://www.ispconfig.org/downloads/ISPConfig-3-nightly.tar.gz"
   28 elif [[ "$SOURCE" == "git-develop" ]] ; then
   29     URL="https://git.ispconfig.org/ispconfig/ispconfig3/-/archive/develop/ispconfig3-develop.tar.gz"
   30 else 
   31     echo "Please choose an installation source (stable, nightly, git-develop)"
   32     exit 1
   33 fi
   34 
   35 CURDIR=$PWD
   36 
   37 cd /tmp
   38 
   39 {
   40 if [ -n "${_UPD}" ]
   41 then
   42     {
   43         save_umask=`umask`
   44         umask 0077 \
   45         && tmpdir=`mktemp -dt "$(basename $0).XXXXXXXXXX"` \
   46         && test -d "${tmpdir}" \
   47         && cd "${tmpdir}"
   48         umask $save_umask
   49     } || {
   50         echo 'mktemp failed'
   51         exit 1
   52     }
   53 
   54     echo "Downloading ISPConfig update."
   55     wget -q -O ISPConfig-3.tar.gz "${URL}"
   56     if [ -f ISPConfig-3.tar.gz ]
   57     then
   58         echo "Unpacking ISPConfig update."
   59         tar xzf ISPConfig-3.tar.gz --strip-components=1
   60         cd install/
   61         php -q \
   62             -d disable_classes= \
   63             -d disable_functions= \
   64             -d open_basedir= \
   65             update.php
   66         cd /tmp
   67         rm -rf "${tmpdir}"
   68     else
   69         echo "Unable to download the update."
   70         cd "$CURDIR"
   71         exit 1
   72     fi
   73 
   74 fi
   75 
   76 cd "$CURDIR"
   77 exit 0
   78 }