Debugging script
This commit is contained in:
24
agent.sh
24
agent.sh
@@ -1,11 +1,18 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
PASS=""
|
#PASSWD
|
||||||
|
|
||||||
|
if [ "$PASS" = "" ]
|
||||||
|
then
|
||||||
echo -n "password : "
|
echo -n "password : "
|
||||||
read -s $PASS
|
read -s input
|
||||||
|
echo ""
|
||||||
|
PASS=$input
|
||||||
|
sed -e 's/^#PASSWD/PASS="'$PASS'"/g' agent.sh > agent.tmp.sh
|
||||||
|
fi
|
||||||
|
|
||||||
id=$1
|
id=$1
|
||||||
|
log_f="log.tmp"
|
||||||
|
|
||||||
center="mickael@172.16.131.74"
|
center="mickael@172.16.131.74"
|
||||||
|
|
||||||
@@ -24,10 +31,13 @@ sshpass -p $PASS ssh-copy-id -o StrictHostKeyChecking=no $host 2> /dev/null;
|
|||||||
sshpass -p $PASS ssh-copy-id -o StrictHostKeyChecking=no $center 2> /dev/null;
|
sshpass -p $PASS ssh-copy-id -o StrictHostKeyChecking=no $center 2> /dev/null;
|
||||||
|
|
||||||
scp -o StrictHostKeyChecking=no $host:config $remote:config;
|
scp -o StrictHostKeyChecking=no $host:config $remote:config;
|
||||||
scp -o StrictHostKeyChecking=no $host:agent.sh $remote:agent.sh;
|
scp -o StrictHostKeyChecking=no $host:agent.tmp.sh $remote:agent.tmp.sh;
|
||||||
scp -o StrictHostKeyChecking=no $host:analyze.sh $remote:analyze.sh;
|
scp -o StrictHostKeyChecking=no $host:analyze.sh $remote:analyze.sh;
|
||||||
./analyze.sh;
|
chmod u+x agent.tmp.sh;
|
||||||
scp -o StrictHostKeyChecking=no log $center:log/log-$remote;
|
chmod u+x analyze.sh;
|
||||||
rm log;
|
./analyze.sh $log_f;
|
||||||
./agent.sh $id;"
|
scp -o StrictHostKeyChecking=no $log_f $center:log/log-$remote;
|
||||||
|
rm $log_f;
|
||||||
|
./agent.tmp.sh $id;"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
18
analyze.sh
18
analyze.sh
@@ -1,15 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Indique au système que l'argument qui suit est le programme utilisé pour exécuter ce fichier
|
# Indique au système que l'argument qui suit est le programme utilisé pour exécuter ce fichier
|
||||||
# En règle générale, les "#" servent à mettre en commentaire le texte qui suit comme ici
|
# En règle générale, les "#" servent à mettre en commentaire le texte qui suit comme ici
|
||||||
touch log
|
file=$1
|
||||||
echo PROCESS > log
|
echo PROCESS > $file
|
||||||
ps >> log
|
ps >> $file
|
||||||
echo TACHE >> log
|
echo TACHE >> $file
|
||||||
echo PERIPHERIQUE >> log
|
echo PERIPHERIQUE >> $file
|
||||||
lsusb >> log
|
lsusb >> $file
|
||||||
lspci >> log
|
lspci >> $file
|
||||||
echo MODELE >> log
|
echo MODELE >> $file
|
||||||
cat /proc/version >> log
|
cat /proc/version >> $file
|
||||||
echo COPIE LOG
|
echo COPIE LOG
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
mickael@172.16.131.33
|
mickael@172.16.131.32
|
||||||
mickael@172.16.131.74
|
mickael@172.16.131.74
|
||||||
Reference in New Issue
Block a user