added -j option
parent
083850431c
commit
d45ee35d23
|
@ -1,11 +1,27 @@
|
|||
#!/bin/bash
|
||||
|
||||
LOCATIONS="nova singapore sydney dublin brazil"
|
||||
SSHKEY="~/.ssh/id-paco-2022"
|
||||
if [[ "$USER" == "nick" ]]; then
|
||||
SSHKEY="~/.ssh/id-nick"
|
||||
else
|
||||
SSHKEY="~/.ssh/id-paco-2022"
|
||||
fi
|
||||
|
||||
while getopts "j" arg; do
|
||||
case "$arg" in
|
||||
j )
|
||||
JUST_ACCESS='true'
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
for location in ${LOCATIONS}
|
||||
do
|
||||
OUTDIR="logs/${location}"
|
||||
[[ -d ${OUTDIR} ]] || mkdir -p ${OUTDIR}
|
||||
if [[ -n "$JUST_ACCESS" ]]; then
|
||||
scp -pr -i ${SSHKEY} "admin@${location}.nickhope.world:/var/log/apache2/access.log" ${OUTDIR}
|
||||
else
|
||||
scp -pr -i ${SSHKEY} "admin@${location}.nickhope.world:/var/log/apache2" ${OUTDIR}
|
||||
fi
|
||||
done
|
Loading…
Reference in New Issue