Changeset 4 for trunk/install.sh


Ignore:
Timestamp:
01/05/08 20:38:15 (4 years ago)
Author:
kay
Message:

install und uninstall Script ueberarbeitet

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/install.sh

    r3 r4  
    2222# $URL$ 
    2323 
    24 cp -R -p ./addons/ /opt/pdadmin/; 
    25 cp -R -p ./www/ /opt/pdadmin/; 
     24preConfFileNames='addon_restartApache'; 
     25preSuidAdministratorFileNames='addon_restartApache'; 
     26preSuidCustomerFileNames=''; 
     27preUninstallFileNames='addon_restartApache'; 
     28copyDirs='addons www'; 
    2629 
    27 chown root:www /opt/pdadmin/www/administrator/addon_restartApache.cgi; 
    28 chmod u+s /opt/pdadmin/www/administrator/addon_restartApache.cgi; 
     30prompt(){ 
     31  answer='' 
     32  while [ true ]; do 
     33    echo -n "overwrite existing configuration (${1})? [yN] "; 
     34    read readAnswer 
     35    readAnswer=$(echo ${readAnswer} | tr [:upper:] [:lower:]); 
     36     
     37    if [ "$readAnswer" == 'y' ] || [ "$readAnswer" == 'j' ] || [ "$readAnswer" == 'n' ]; then 
     38      answer=$readAnswer; 
     39    elif [ "$readAnswer" == '' ]; then 
     40      answer='n'; 
     41    else 
     42      answer=''; 
     43    fi 
     44    if [ "$answer" != '' ]; then 
     45      break; 
     46    fi 
     47  done 
     48} 
     49 
     50 
     51for conf in $preConfFileNames; do 
     52  if [ -f /opt/pdadmin/addons/conf/$conf.conf ]; then 
     53    prompt $conf.conf; 
     54    if [ "$answer" == 'n' ]; then 
     55      cp -i -p /opt/pdadmin/addons/conf/$conf.conf /opt/pdadmin/addons/conf/$conf.conf.bak; 
     56    fi 
     57  fi 
     58done 
     59 
     60for dir in $copyDirs; do 
     61  if [ -d ./$dir ]; then 
     62    cp -R -p ./$dir/ /opt/pdadmin/; 
     63  fi 
     64done 
     65 
     66for suid in $preSuidAdministratorFileNames; do 
     67  if [ -f /opt/pdadmin/www/administrator/$suid.cgi ]; then 
     68    chown root:www /opt/pdadmin/www/administrator/$suid.cgi; 
     69    chmod u+s /opt/pdadmin/www/administrator/$suid.cgi; 
     70  fi 
     71done 
     72 
     73for suid in $preSuidCustomerFileNames; do 
     74  if [ -f /opt/pdadmin/www/customer/$suid.cgi ]; then 
     75    chown root:www /opt/pdadmin/www/customer/$suid.cgi; 
     76    chmod u+s /opt/pdadmin/www/customer/$suid.cgi; 
     77  fi 
     78done 
     79 
     80for uninstall in $preUninstallFileNames; do 
     81  if [ -f /opt/pdadmin/addons/share/$uninstall.uninstall.sh ]; then 
     82    chmod 0700 /opt/pdadmin/addons/share/$uninstall.uninstall.sh; 
     83  fi 
     84done 
     85 
     86for conf in $preConfFileNames; do 
     87  if [ -f /opt/pdadmin/addons/conf/$conf.conf.bak ]; then 
     88    mv /opt/pdadmin/addons/conf/$conf.conf.bak /opt/pdadmin/addons/conf/$conf.conf; 
     89  fi 
     90done 
Note: See TracChangeset for help on using the changeset viewer.