WolfPack/offload-wolfpack

19 lines
709 B
Bash
Executable File

#!/bin/bash
if [ "$(pgrep -afc wolfpack)" -ne 1 ]; then
echo WolfPack is already working elsewhere.
exit 1
fi
/usr/local/bin/wolfpack --alpha
sleep 10
rsync -avz /srv/yggdrasil/new_acquisition/* cxford@10.0.1.3:/srv/yggdrasil/new_acquisition &>>/var/log/wolfpack.log
ls -l /srv/yggdrasil/new_acquisition >> /var/log/wolfpack.log
echo Files transferred from $(uname -n). >> /var/log/wolfpack.log
rm -Rf /srv/yggdrasil/new_acquisition/*
cat /var/log/wolfpack.log | ssh cxford@aninix.net "cat >> /var/log/wolfpack.log"
rm /var/log/wolfpack.log
for i in $(ls /usr/local/etc/WolfPack/*.pup); do
export cmdstring="$(echo $i | sed "s/pup/$(uname -n)/")"
scp "$i" cxford@aninix.net:"$cmdstring"
done