[ PHPXref.com ] [ Generated: Sun Jul 20 18:16:01 2008 ] [ ISPConfig 2.2.1 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> setup1 (source)

   1  #!/bin/bash
   2  ###############################################################################
   3  # Copyright (c) 2005, projektfarm Gmbh, Till Brehm, Falko Timme
   4  # All rights reserved.
   5  #
   6  # Redistribution and use in source and binary forms, with or without modification,
   7  # are permitted provided that the following conditions are met:
   8  #
   9  #     * Redistributions of source code must retain the above copyright notice,
  10  #       this list of conditions and the following disclaimer.
  11  #     * Redistributions in binary form must reproduce the above copyright notice,
  12  #       this list of conditions and the following disclaimer in the documentation
  13  #       and/or other materials provided with the distribution.
  14  #     * Neither the name of ISPConfig nor the names of its contributors
  15  #       may be used to endorse or promote products derived from this software without
  16  #       specific prior written permission.
  17  #
  18  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  19  # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  20  # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  21  # IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  22  # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  23  # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  24  # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  25  # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  26  # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  27  # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28  ###############################################################################
  29  
  30  log(){
  31    LOGFILE=/var/log/ispconfig_install.log
  32    echo `date` "- [ISPConfig] - "$1 >> $LOGFILE
  33  }
  34  
  35  error ()
  36  {
  37    log  "ERROR: $1"
  38    echo "ERROR: $1"
  39    exit 1
  40  }
  41  
  42  ID="id -u"
  43  MYUID=`$ID 2>/dev/null`
  44  
  45  if [ ! -z "$MYUID" ];
  46  then
  47    if [ $MYUID != 0 ];
  48    then
  49      error "Sie benötigen root-Rechte zum Ausführen dieses Skriptes! / You need root privileges to run this script! / Vous devez avoir les privileges root pour executer ce script!";
  50    fi
  51  fi
  52  
  53  log "installation directory: `pwd`"
  54  
  55  if [ -f /etc/release ] && [ ! -h  /etc/release ]; then
  56     version=`cat /etc/release | grep -i release | cut -f5 -d' '`
  57     echo $version | grep \\. &> /dev/null
  58     if [ $? != 0 ]; then
  59       version=`echo $version.0`
  60     fi
  61     distversion=`echo Trustix $version`
  62     echo $distversion
  63     distvers=Trustix$version//./}
  64     echo dist=$distvers '##' > dist.info.tmp
  65     grep -i $distvers dist.txt >> dist.info.tmp
  66     cp -f dist.info.tmp dist.info
  67     VAR1=`cat dist.info.tmp | cut -f1 -d=`
  68     for var1 in $VAR1
  69     do
  70       echo export $var1 >> dist.info.ende
  71     done
  72     cat dist.info.ende >> dist.info.tmp
  73     rm -f dist.info.ende
  74  fi
  75  if [ -f /etc/SuSE-release ] && [ ! -h  /etc/SuSE-release ]; then
  76     version=`cat /etc/SuSE-release | grep -i VERSION | cut -f3 -d' '`
  77     echo $version | grep \\. &> /dev/null
  78     if [ $? != 0 ]; then
  79       version=`echo $version.0`
  80     fi
  81     distversion=`echo SuSE $version`
  82     echo $distversion
  83     distvers=suse$version//./}
  84     echo dist=$distvers '##' > dist.info.tmp
  85     grep -i $distvers dist.txt >> dist.info.tmp
  86     cp -f dist.info.tmp dist.info
  87     VAR1=`cat dist.info.tmp | cut -f1 -d=`
  88     for var1 in $VAR1
  89     do
  90       echo export $var1 >> dist.info.ende
  91     done
  92     cat dist.info.ende >> dist.info.tmp
  93     rm -f dist.info.ende
  94  fi
  95  if [ -f /etc/mandrake-release ] && [ ! -h  /etc/mandrake-release ]; then
  96     version=`cat /etc/mandrake-release | cut -f4 -d' '`
  97     echo $version | grep \\. &> /dev/null
  98     if [ $? != 0 ]; then
  99       version=`echo $version.0`
 100     fi
 101     distversion=`echo Mandrake $version`
 102     echo $distversion
 103     version=`echo $version | cut -f1 -dr`
 104     distvers=mdk$version//./}
 105     echo dist=$distvers '##' > dist.info.tmp
 106     grep -i $distvers dist.txt >>  dist.info.tmp
 107     cp -f dist.info.tmp dist.info
 108     VAR1=`cat dist.info.tmp | cut -f1 -d=`
 109     for var1 in $VAR1
 110     do
 111       echo export $var1 >> dist.info.ende
 112     done
 113     cat dist.info.ende >> dist.info.tmp
 114     rm -f dist.info.ende
 115  fi
 116  if [ -f /etc/mandrakelinux-release ] && [ ! -h  /etc/mandrakelinux-release ]; then
 117     version=`cat /etc/mandrake-release | cut -f3 -d' '`
 118     echo $version | grep \\. &> /dev/null
 119     if [ $? != 0 ]; then
 120       version=`echo $version.0`
 121     fi
 122     distversion=`echo Mandrake $version`
 123     echo $distversion
 124     version=`echo $version | cut -f1 -dr`
 125     distvers=mdk$version//./}
 126     echo dist=$distvers '##' > dist.info.tmp
 127     grep -i $distvers dist.txt >>  dist.info.tmp
 128     cp -f dist.info.tmp dist.info
 129     VAR1=`cat dist.info.tmp | cut -f1 -d=`
 130     for var1 in $VAR1
 131     do
 132       echo export $var1 >> dist.info.ende
 133     done
 134     cat dist.info.ende >> dist.info.tmp
 135     rm -f dist.info.ende
 136  fi
 137  if [ -f /etc/mandriva-release ] && [ ! -h  /etc/mandriva-release ]; then
 138     version=`cat /etc/mandriva-release | cut -f4 -d' '`
 139     echo $version | grep \\. &> /dev/null
 140     if [ $? != 0 ]; then
 141       version=`echo $version.0`
 142     fi
 143     distversion=`echo Mandriva $version`
 144     echo $distversion
 145     version=`echo $version | cut -f1 -dr`
 146     distvers=mdr$version//./}
 147     echo dist=$distvers '##' > dist.info.tmp
 148     grep -i $distvers dist.txt >>  dist.info.tmp
 149     cp -f dist.info.tmp dist.info
 150     VAR1=`cat dist.info.tmp | cut -f1 -d=`
 151     for var1 in $VAR1
 152     do
 153       echo export $var1 >> dist.info.ende
 154     done
 155     cat dist.info.ende >> dist.info.tmp
 156     rm -f dist.info.ende
 157  fi
 158  if [ -f /etc/redhat-release ] && [ ! -h  /etc/redhat-release ]; then
 159     version=`cat /etc/redhat-release | cut -f5 -d' '`
 160     if [ -n '$version' ]; then
 161       version=`cat /etc/redhat-release | cut -f3 -d' '`
 162     fi
 163     echo $version | grep \\. &> /dev/null
 164     if [ $? != 0 ]; then
 165       version=`echo $version.0`
 166     fi
 167     if [ "`cat /etc/redhat-release | cut -f1 -d' '`" == "CentOS" ]; then
 168       distversion=`echo CentOS $version`
 169       echo $distversion
 170       distvers=centos$version//./}
 171     else
 172       distversion=`echo RedHat $version`
 173       echo $distversion
 174       distvers=rhat$version//./}
 175     fi
 176     echo dist=$distvers '##' > dist.info.tmp
 177     grep -i $distvers dist.txt >> dist.info.tmp
 178     cp -f dist.info.tmp dist.info
 179     VAR1=`cat dist.info.tmp | cut -f1 -d=`
 180     for var1 in $VAR1
 181     do
 182       echo export $var1 >> dist.info.ende
 183     done
 184     cat dist.info.ende >> dist.info.tmp
 185     rm -f dist.info.ende
 186  fi
 187  if [ -f /etc/fedora-release ] && [ ! -h  /etc/fedora-release ]; then
 188     version=`cat /etc/fedora-release | cut -f4 -d' '`
 189     echo $version | grep \\. &> /dev/null
 190     if [ $? != 0 ]; then
 191       version=`echo $version.0`
 192     fi
 193     distversion=`echo Fedora $version`
 194     echo $distversion
 195     distvers=fedora$version//./}
 196     echo dist=$distvers '##' > dist.info.tmp
 197     grep -i $distvers dist.txt >> dist.info.tmp
 198     cp -f dist.info.tmp dist.info
 199     VAR1=`cat dist.info.tmp | cut -f1 -d=`
 200     for var1 in $VAR1
 201     do
 202       echo export $var1 >> dist.info.ende
 203     done
 204     cat dist.info.ende >> dist.info.tmp
 205     rm -f dist.info.ende
 206  fi
 207  if [ -f /etc/debian_version ] && [ ! -h  /etc/debian_version ]; then
 208     version=`cat /etc/debian_version`
 209     echo $version | grep \\. &> /dev/null
 210     if [ $? != 0 ]; then
 211       version=`echo $version.0`
 212     fi
 213     distversion=`echo Debian $version`
 214     echo $distversion
 215     distvers=debian$version//./}
 216     echo dist=$distvers '##' > dist.info.tmp
 217     grep -i $distvers dist.txt >> dist.info.tmp
 218     cp -f dist.info.tmp dist.info
 219     VAR1=`cat dist.info.tmp | cut -f1 -d=`
 220     for var1 in $VAR1
 221     do
 222       echo export $var1 >> dist.info.ende
 223     done
 224     cat dist.info.ende >> dist.info.tmp
 225     rm -f dist.info.ende
 226  fi
 227  if [ -f /etc/slackware-version ] && [ ! -h  /etc/slackware-version ]; then
 228     version=`cat /etc/slackware-version | cut -f2 -d' '`
 229     echo $version | grep \\. &> /dev/null
 230     if [ $? != 0 ]; then
 231       version=`echo $version.0`
 232     fi
 233     distversion=`echo Slackware $version`
 234     echo $distversion
 235     distvers=slackware$version//./}
 236     echo dist=$distvers '##' > dist.info.tmp
 237     grep -i $distvers dist.txt >> dist.info.tmp
 238     cp -f dist.info.tmp dist.info
 239     VAR1=`cat dist.info.tmp | cut -f1 -d=`
 240     for var1 in $VAR1
 241     do
 242       echo export $var1 >> dist.info.ende
 243     done
 244     cat dist.info.ende >> dist.info.tmp
 245     rm -f dist.info.ende
 246  fi
 247  if [ ! -n "$distvers" ]; then
 248    os=`uname -rs |cut -f1 -d' '`
 249    if [ "$os" == "FreeBSD" ]; then
 250      version=`uname -rs | cut -f2 -d' ' | cut -f1 -d-`
 251      echo $version | grep \\. &> /dev/null
 252      if [ $? != 0 ]; then
 253        version=`echo $version.0`
 254      fi
 255      distversion=`echo FreeBSD $version`
 256      echo $distversion
 257      distvers=freebsd$version//./}
 258      echo dist=$distvers '##' > dist.info.tmp
 259      grep -i $distvers dist.txt >> dist.info.tmp
 260      cp -f dist.info.tmp dist.info
 261      VAR1=`cat dist.info.tmp | cut -f1 -d=`
 262      for var1 in $VAR1
 263      do
 264        echo export $var1 >> dist.info.ende
 265      done
 266      cat dist.info.ende >> dist.info.tmp
 267      rm -f dist.info.ende
 268    fi
 269  fi
 270  
 271  log "operating system: $distversion"
 272  dist_supported=`grep -i "$distvers" dist.txt`
 273  
 274  if [ "$dist_supported" == "" ] || [ "$distvers" == "" ]; then
 275    error "Ihr Betriebssystem wird nicht unterstützt! / Your operating system is not supported! / Votre systeme d'exploitation n'est pas supporté!"
 276  fi
 277  
 278  if [ -d /root/ispconfig ] && [ -d /home/admispconfig ]; then
 279    export install_art=upgrade
 280  else
 281    export install_art=install
 282  fi
 283  
 284  sleep 3
 285  
 286  chmod 700 setup2
 287  ./setup2
 288  
 289  exit 0;


[ Powered by PHPXref - Served by Debian GNU/Linux ]