"Fossies" - the Fresh Open Source Software Archive

Member "astrocam-2.7.6/install.sh" (26 May 2009, 3770 Bytes) of package /linux/www/old/astrocam-2.7.6.tgz:


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. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/bash
    2 
    3 # v.2.3p0-non-auto, 23-Jan-2009
    4 # 
    5 # astrocam installation script by Steffen Wendzel
    6 # (C) 2004-2009 by steffen wendzel
    7 
    8 ### astrocam >= 2.7.5 install script ###
    9 
   10 ID=`id -u`
   11 
   12 if [ "$ID" != "0" ]; then
   13    echo "need root access to install astrocam!"
   14    exit
   15 fi
   16 
   17 ###########################
   18 #### create default values
   19 ###########################
   20 
   21 HTDOCS_P[0]="/var/www/htdocs"
   22 HTDOCS_P[1]="/var/www"
   23 HTDOCS_P[2]="/usr/local/apache/htdocs"
   24 HTDOCS_P[3]="/usr/local/httpd/htdocs"
   25 HTDOCS_P[4]="/usr/apache/htdocs"
   26 HTDOCS_P[5]="/usr/httpd/htdocs"
   27 HTDOCS_P[6]="/var/web"          # myserver
   28 
   29 CGI_P[0]="/usr/lib/cgi-bin"
   30 CGI_P[1]="${HTDOCS_P[0]}/../cgi-bin"
   31 CGI_P[2]="${HTDOCS_P[1]}/../cgi-bin"
   32 CGI_P[3]="${HTDOCS_P[2]}/../cgi-bin"
   33 CGI_P[4]="${HTDOCS_P[3]}/../cgi-bin"
   34 CGI_P[5]="${HTDOCS_P[6]}/cgi-bin/"  # myserver
   35 
   36 MAN_P[0]="/usr/man"
   37 MAN_P[1]="/usr/share/man/"
   38 MAN_P[2]="/usr/local/man/"
   39 
   40 DOC_P[0]="/usr/share/doc"
   41 DOC_P[1]="/usr/local/share/doc"
   42 DOC_P[2]="/usr/doc"
   43 
   44 HTDOCS="not set"
   45 CGI="not set"
   46 MANPATH="not set"
   47 
   48 for value in ${HTDOCS_P[*]}; do if [ -d $value ]; then HTDOCS=$value; break; fi; done
   49 for value in ${CGI_P[*]}; do if [ -d $value ]; then CGI=$value; break; fi; done
   50 for value in ${MAN_P[*]}; do if [ -d $value ]; then MANPATH=$value; break; fi; done
   51 for value in ${DOC_P[*]}; do if [ -d $value ]; then DOCPATH=$value; break; fi; done
   52 
   53 #############################
   54 #### main script starts here
   55 #############################
   56 
   57 echo "       ---:{   AstroCam Installer Version 2.0   }:---"
   58 echo
   59 echo "I hope you read the INSTALL-file and modified astrocam.h (if needed) ..."
   60 echo
   61 
   62 
   63 # htdocs
   64 echo -n "Please enter your web site directory [default is $HTDOCS]: "
   65 read new
   66 if [ "$new" != "" ]; then
   67     while [ ! -d "$new" ]; do
   68         echo "error: directory does not exist!."
   69         echo -n "please enter a valid path: "
   70         read new
   71     done
   72     HTDOCS="${new}/astrocam"
   73 fi
   74 
   75 # cgi
   76 echo -n "Please enter your CGI directory [default is $CGI]: "
   77 read new
   78 if [ "$new" != "" ]; then
   79     while [ ! -d "$new" ]; do
   80         echo "error: directory does not exist!."
   81         echo -n "please enter a valid path: "
   82         read new
   83     done
   84     CGI="${new}"
   85 fi
   86 
   87 # manpath
   88 echo -n "Please enter your manpage path [default is $MANPATH]: "
   89 read new
   90 if [ "$new" != "" ]; then
   91     while [ ! -d "$new" ]; do
   92         echo "error: directory does not exist!."
   93         echo -n "please enter a valid path: "
   94         read new
   95     done
   96     MANPATH="${new}/man7"
   97 fi
   98 
   99 # docpath
  100 echo -n "Please enter your documentation path [default is $DOCPATH]: "
  101 read new
  102 if [ "$new" != "" ]; then
  103     while [ ! -d "$new" ]; do
  104         echo "error: directory does not exist!."
  105         echo -n "please enter a valid path: "
  106         read new
  107     done
  108     DOCPATH="${new}"
  109 fi
  110 
  111 # config file
  112 cp -v astrocam.conf /etc/astrocam.conf
  113 chmod 644 /etc/astrocam.conf
  114 
  115 # php+content
  116 if [ ! -d ${HTDOCS}/astrocam ]; then
  117     mkdir -p $HTDOCS/astrocam
  118 fi
  119 
  120 cp -v *.php *.css *.gif $HTDOCS/astrocam/
  121 chmod -R ugo+rx $HTDOCS/astrocam
  122 
  123 # cgi scripts
  124 cp -v astrocam.pl pic.pl $CGI/
  125 chmod 755 $CGI/astrocam.pl  $CGI/pic.pl
  126 
  127 # binary
  128 echo "installing astrocam daemon binary and acam_console.pl in /usr/local/sbin"
  129 if [ ! -d /usr/local/sbin ]; then
  130     mkdir /usr/local/sbin
  131 fi
  132 cp -v astrocam acam_console.pl /usr/local/sbin/
  133 chmod 500 /usr/local/sbin/astrocam /usr/local/sbin/acam_console.pl
  134 
  135 # manpages
  136 if [ ! -d ${MANPATH}/man7 ]; then
  137     mkdir -p $MANPATH
  138 fi
  139 cp -v astrocam.7 $MANPATH/man7/astrocam.7
  140 
  141 # docs
  142 if [ -d ${DOCPATH}/astrocam ]; then
  143     # remove old content
  144     rm -rf ${DOCPATH}/astrocam/*
  145 fi
  146 if [ ! -d ${DOCPATH}/astrocam ]; then
  147     mkdir -p ${DOCPATH}/astrocam || exit 1
  148 fi
  149 cp -v AUTHOR BUGS LICENSE CHANGELOG INSTALL ${DOCPATH}/astrocam/
  150 
  151 # last msg. done.
  152 echo
  153 echo "installation done!"
  154 echo "    now just edit /etc/astrocam.conf and run 'astrocam' to"
  155 echo "    start the daemon. thank you for using astrocam!"
  156 echo
  157