1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253
| #!/bin/bash
#
# Definit les variables de départ
INSTALL_TOMCAT=$(pwd)
# Nous définissons les utilisateurs de tomcat.
user_tomcat='tomcat'
user_default="utilisateur" #Si on veut ajouté l'utilisateur au groupe tomcat
#partie servant a connaitre les plateformes à déployer et leurs nombres.
#dans ce script, nous repartons toujours de zerro
i_fin=0
for ((i=0; i<=$i_fin; i++))
do
if [[ $i == 0 ]]; then
echo "Sur quelle(s) plateforme(s) voulez-vous déployer TOMCAT"
echo "[Taper un nom de plateforme ou valider par \"Entrer\" pour la valeur par defaut=>prod]"
read plateforme
if [ "$plateforme" = "" ]; then
tab_platform[$i]="prod"
i_fin=$i
else
tab_platform[$i]=$plateforme
i_fin=$((i+1))
fi
else
echo "Entrer une nouvelle plateforme ou valider par \"entrer\" pour mettre fin à la saisi des plateformes:"
read plateforme
if [ -z $plateforme ]; then
i_fin=$((i-1))
((i--))
else
tab_platform[$i]=$plateforme
i_fin=$((i+1))
fi
fi
done
echo "il y a $i platforme(s)"
# nous recherchons la dernière version de Tomcat
TOMCAT_VERSION=$(wget -q -O- http://archive.apache.org/dist/tomcat/|grep -o 'tomcat-[0-9]\{1,2\}\+'|sed 's/tomcat-//'|sort -n|tail -1)
echo "La dernière version majeur de tomcat est: $TOMCAT_VERSION"
TOMCAT_VERSION_COMPLETE=$(wget -q -O- http://archive.apache.org/dist/tomcat/tomcat-$TOMCAT_VERSION/|grep -o "v$TOMCAT_VERSION\.[0-9]\{1,2\}\.\+"|sed "s/v$TOMCAT_VERSION\.//"|sed "s/\.//"|sort -n|tail -1)
echo "La dernière version intermédiaire de tomcat est: $TOMCAT_VERSION.$TOMCAT_VERSION_COMPLETE"
TOMCAT_VERSION_COMPLETE="$TOMCAT_VERSION.$TOMCAT_VERSION_COMPLETE.$(wget -q -O- http://archive.apache.org/dist/tomcat/tomcat-$TOMCAT_VERSION/|grep -o "v$TOMCAT_VERSION\.$TOMCAT_VERSION_COMPLETE\.[0-9]\+"|sed "s/v$TOMCAT_VERSION\.$TOMCAT_VERSION_COMPLETE\.//"|sort -n|tail -1)"
echo "La version finale de TOMCAT est $TOMCAT_VERSION_COMPLETE"
# si le répertoire de la dernière version n'existe pas, nous exécuton le if.
if [ ! -d $INSTALL_TOMCAT/apache-tomcat-$TOMCAT_VERSION_COMPLETE ]; then
# si des anciennes versions décompressées existent, nous les supprimons
if [[ $(ls -1d $INSTALL_TOMCAT/apache-tomcat-*/ 2>/dev/null) ]]; then
echo "Suppression des anciennes versions de TOMCAT (répertoire)"
rm -rf $INSTALL_TOMCAT/apache-tomcat-*/
fi
#si le dernier fichier d'intall n'existe pas, nous le téléchargerons
if [ ! -f $INSTALL_TOMCAT/apache-tomcat-$TOMCAT_VERSION_COMPLETE.tar.gz ]; then
#si des versions antérieurs ont été téléchargées, nous les supprimerons
if [[ $(ls -1 $INSTALL_TOMCAT/apache-tomcat-*.tar.gz 2>/dev/null) ]]; then
echo "Suppression des anciennes versions de TOMCAT téléchargées"
rm $INSTALL_TOMCAT/apache-tomcat-*tar.gz
else
echo "Aucune version antérieur n'a été téléchargé"
fi
echo "Téléchargement de la dernière versions de TOMCAT"
wget apache.crihan.fr/dist/tomcat/tomcat-$TOMCAT_VERSION/v$TOMCAT_VERSION_COMPLETE/bin/apache-tomcat-$TOMCAT_VERSION_COMPLETE.tar.gz
fi
echo "Extraction de la dernière versions de TOMCAT"
tar -xf "$INSTALL_TOMCAT/apache-tomcat-$TOMCAT_VERSION_COMPLETE.tar.gz"
else
echo "La dernière version de Tomcat est déjà décompressé, nous continuons!!!"
fi
#Suppression des installations preexistantes
if [[ $(ls -1d tomcat_* 2>/dev/null) ]]; then
for f in $(ls -1d tomcat_*); do
echo "La précédente installation de \"$f\" va etre supprimée"
rm -rf $INSTALL_TOMCAT/$f
update-rc.d -f $f remove
rm /etc/init.d/$f
done
else
echo "Pas d'installation déjà réalisée, nous continuons!!!"
fi
#vérification que le groupe Tomcat existe
if id -g $user_tomcat >/dev/null 2>&1; then
echo "le groupe $user_tomcat existe, on continu!!!"
user_valid=1
else
echo "le groupe $user_tomcat n'existe pas, il sera ajouté."
groupadd $user_tomcat
fi
#vérification que l'utilisateur Tomcat existe
if id -u $user_tomcat >/dev/null 2>&1; then
echo "l'utilisateur $user_tomcat existe, on continu!!!"
user_valid=1
else
echo "l'utilisateur $user_tomcat n'existe pas, il sera ajouté."
useradd -s /sbin/nologin -M -g $user_tomcat -d $INSTALL_TOMCAT/tomcat_$PLATFORME $user_tomcat
if [ -n $user_default]; then
usermod -a -G $user_tomcat $user_default
fi
usermod -G $user_tomcat $user_tomcat #au cas ou ce n'a pas été déjà fait!!!
usermod -G www-data $user_tomcat
fi
for ((i=0; i<=$i_fin; i++))
do
PLATFORME=${tab_platform[i]}
SHUTDOWN_PORT=$((8010+i))
TOMCAT_HTTP_PORT=$(( 8010 + $i_fin + 1 + i ))
TOMCAT_SSL_PORT=$((8444+i))
TOMCAT_AJP_PORT=$(( 8010 + 2 * ($i_fin + 1) + i ))
cp -R $INSTALL_TOMCAT/apache-tomcat-$TOMCAT_VERSION_COMPLETE $INSTALL_TOMCAT/tomcat_$PLATFORME
touch $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
touch $INSTALL_TOMCAT/tomcat_$PLATFORME/conf/default_$PLATFORME
touch $INSTALL_TOMCAT/tomcat_$PLATFORME/conf/tomcat_$PLATFORME.pid
echo ""
echo "Modification de Shutdown en \"$PLATFORME\" du port = 8005 => $SHUTDOWN_PORT"
find $INSTALL_TOMCAT/tomcat_$PLATFORME/ -type f -exec sed -i "s|port=\"8005\"|port=\"$SHUTDOWN_PORT\"|g" {} \;
echo "Modification de non-SSL/TLS HTTP/1.1 Connector on \"$PLATFORME\" on port 8080 => $TOMCAT_HTTP_PORT"
find $INSTALL_TOMCAT/tomcat_$PLATFORME/ -type f -exec sed -i "s|port=\"8080\"|port=\"$TOMCAT_HTTP_PORT\"|g" {} \;
echo "Modification de SSL/TLS HTTP/1.1 Connector on \"$PLATFORME\" on port 8443 => $TOMCAT_SSL_PORT"
find $INSTALL_TOMCAT/tomcat_$PLATFORME/ -type f -exec sed -i "s|redirectPort=\"8443\"|redirectPort=\"$TOMCAT_SSL_PORT\"|g" {} \;
echo "Modification de AJP 1.3 Connector on \"$PLATFORME\" on port 8009 => $TOMCAT_AJP_PORT"
find $INSTALL_TOMCAT/tomcat_$PLATFORME/ -type f -exec sed -i "s|port=\"8009\"|port=\"$TOMCAT_AJP_PORT\"|g" {} \;
echo "Début d'écriture du fichier tomcat_$PLATFORME"
echo "#!/bin/sh">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "#">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "# /etc/init.d/tomcat_$PLATFORME -- startup script for the Tomcat_$PLATFORME servlet engine">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "#">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "# Written by *** <***@***>.">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "# Modified for *** by *** <***@***>.">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "#">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "### BEGIN INIT INFO">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "# Provides: tomcat_$PLATFORME">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "# Required-Start: \$local_fs \$remote_fs \$network">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "# Required-Stop: \$local_fs \$remote_fs \$network">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "# Should-Start: \$named">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "# Should-Stop: \$named">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "# Default-Start: 2 3 4 5">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "# Default-Stop: 0 1 6">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "# Short-Description: Start Tomcat_$PLATFORME.">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "# Description: Start the Tomcat servlet engine.">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "### END INIT INFO">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "TOMCAT_$PLATFORME=$INSTALL_TOMCAT/tomcat_$PLATFORME">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "if [ id -u -ne 0 ]; then">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " echo \"You need root privileges to run this script\"">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " exit 1">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "fi">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "# Make sure tomcat is started with system locale">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "if [ -r /etc/default/locale ]; then">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " . /etc/default/locale">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " export LANG">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "fi">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo ". /lib/lsb/init-functions">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "if [ -r /etc/default/rcS ]; then">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " . /etc/default/rcS">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "fi">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "if [ ! -z \"\$1\" ]; then">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " echo \$1 | grep \"[^0-9]\" >/dev/null 2>&1">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " if [ \$? -gt 0 ]; then">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " TEMPO=\$1">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " fi">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "fi">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "case \"\$1\" in">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " debug)">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " sh \$TOMCAT_$PLATFORME/bin/catalina.sh debug">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " ;;">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " \"debug -security\")">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " sh \$TOMCAT_$PLATFORME/bin/catalina.sh debug -security">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " ;;">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " \"jpda start\")">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " sh \$TOMCAT_$PLATFORME/bin/catalina.sh jpda start">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " ;;">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " run)">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " sh \$TOMCAT_$PLATFORME/bin/catalina.sh run">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " ;;">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " \"run -security\")">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " sh \$TOMCAT_$PLATFORME/bin/catalina.sh run -security">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " ;;">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " start)">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " sh \$TOMCAT_$PLATFORME/bin/catalina.sh start">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " ;;">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " \"start -security\")">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " sh \$TOMCAT_$PLATFORME/bin/catalina.sh start -security">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " ;;">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " stop)">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " sh \$TOMCAT_$PLATFORME/bin/catalina.sh stop">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " ;;">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " \"stop \$TEMPO\")">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " sh \$TOMCAT_$PLATFORME/bin/catalina.sh stop \$TEMPO">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " ;;">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " \"stop -force\")">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " sh $INSTALL_TOMCAT/tomcat_$PLATFORME/bin/catalina.sh stop -force">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " ;;">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " \"stop \$TEMPO -force\")">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " sh \$TOMCAT_$PLATFORME/bin/catalina.sh stop \$TEMPO -force">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " ;;">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " configtest)">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " sh \$TOMCAT_$PLATFORME/bin/catalina.sh ">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " ;;">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " restart)">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " sh \$TOMCAT_$PLATFORME/bin/catalina.sh stop">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " sh \$TOMCAT_$PLATFORME/bin/catalina.sh start">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " ;;">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " version)">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " sh \$TOMCAT_$PLATFORME/bin/catalina.sh version">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " ;;">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " *)">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " echo \"Usage: tomcat_$PLATFORME ( commands ... )\"">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " echo \"commands:\"">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " if \$os400; then">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " echo \" debug Start Catalina in a debugger (not available on OS400)\"">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " echo \" debug -security Debug Catalina with a security manager (not available on OS400)\"">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " else">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " echo \" debug Start Catalina in a debugger\"">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " echo \" debug -security Debug Catalina with a security manager\"">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " fi">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " echo \" jpda start Start Catalina under JPDA debugger\"">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " echo \" run Start Catalina in the current window\"">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " echo \" run -security Start in the current window with security manager\"">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " echo \" start Start Catalina in a separate window\"">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " echo \" start -security Start in a separate window with security manager\"">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " echo \" stop Stop Catalina, waiting up to 5 seconds for the process to end\"">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " echo \" stop n Stop Catalina, waiting up to n seconds for the process to end\"">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " echo \" stop -force Stop Catalina, wait up to 5 seconds and then use kill -KILL if still running\"">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " echo \" stop n -force Stop Catalina, wait up to n seconds and then use kill -KILL if still running\"">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " echo \" configtest Run a basic syntax check on server.xml - check exit code for result\"">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " echo \" restart Restart Catalina in a separate window\"">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " echo \" version What version of tomcat are you running?\"">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " echo \"Note: Waiting for the process to end and use of the -force option require that \$CATALINA_PROD_PID is defined\"">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " exit 1">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo " ;;">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "esac">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "exit 0">> $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME
echo "Fin d'écriture du fichier tomcat_$PLATFORME"
cp $INSTALL_TOMCAT/tomcat_$PLATFORME/tomcat_$PLATFORME /etc/init.d/tomcat_$PLATFORME
chmod 755 /etc/init.d/tomcat_$PLATFORME
update-rc.d tomcat_$PLATFORME defaults
chown $user_tomcat:$user_tomcat -R $INSTALL_TOMCAT/tomcat_$PLATFORME/
chmod 775 -R $INSTALL_TOMCAT/tomcat_$PLATFORME/
done
echo "Fin" |
Partager