J'ai téléchargé un fichier .sh depuis S3 Bucket en utilisant la commande
/usr/local/bin/aws s3 cp s3://mm-s3-encrypt/AppD.sh /prod/msp/domains/dynamicapp_domains/
Je le vois dans le chemin,
Je fais un
chmod u+x AppD.sh
alors ,
./AppD.sh
Résultat
: [No such file or directory]omains/dynamicapp_domains/
: [No such file or directory]omains/dynamicapp_domains/msp_dynamicapp_tomcat_01/bin
cp: cannot stat `startup.sh': No such file or directory
: No such file or directory
: No such file or directory
: No such file or directory
: No such file or directory
: No such file or directory
--2015-10-28 11:32:24-- https://nexus.kdc.capitalone.com/mother/service/local/repositories/WildWildWest/content/com/AppD_AppAgent/4.1.4.3/AppD_AppAgent-4.1.4.3-AppAgent.zip%0D
Resolving nexus.kdc.capitalone.com... 10.42.17.183
Connecting to nexus.kdc.capitalone.com|10.42.17.183|:443... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authorization failed.
mais séparément ces commandes fonctionnent bien, voici le script.
#!/bin/bash
cd /prod/msp/domains/dynamicapp_domains/.
mkdir -p /AppDynamic/AppAgent
mkdir -p /AppDynamic/MachineAgent
cd /prod/msp/domains/dynamicapp_domains/msp_dynamicapp_tomcat_01/bin/.
cp startup.sh startup.sh_orig
HOST=$(hostname)
sed -i '7iexport
> CATALINA_OPTS="$CATALINA_OPTS-javaagent:/prod/msp/domains/dynamicapp_domains/AppDynamic/AppAgent/ver4.1.4.3/javaagent.jar"'
> startup.sh sed -i '10iENABLE_AppD_PROBE="YES";' startup.sh
sed -i.bak -e '15,16d' startup.sh
sed -i '15iif \[ ! -z \${ENABLE_AppD_PROBE\} \]; then' startup.sh
sed -i '16iPROBE_OPTS="-javaagent:/prod/msp/domains/dynamicapp_domains/AppDynamic/AppAgent/ver4.1.4.3/javaagent.jar -Dprobe.id='"$HOST"'_msp_dynamicapp_tomcat_01 -Dprobe.group='"$HOST"'";' startup.sh
cd /prod/msp/domains/dynamicapp_domains/AppDynamic/AppAgent/.
wget https://nexus.kdc.capitalone.com/mother/service/local/repositories/WildWildWest/content/com/AppD_AppAgent/4.1.4.3/AppD_AppAgent-4.1.4.3-AppAgent.zip