ptut-virtenv/metactl/post-stop.sh

33 lines
919 B
Bash

#!/bin/bash
source $(dirname `realpath $0`)/environment.sh;
############################################
## ##
## Executed after stopping containers ##
## ##
############################################
# 1. Stop 'env' spy
echo -ne " * Kill 'env' spy............";
PID_FILE="$ROOT/ci/env.pid";
if [ -f $PID_FILE ]; then
kill -9 `cat $PID_FILE` 2>/dev/null && echo "killed" || (echo "fail"; exit 1);
else
echo "already";
fi;
rm $PID_FILE >/dev/null 2>&1;
# 2. Stop 'web' spy
echo -ne " * Kill 'web' spy............";
PID_FILE="$ROOT/ci/web.pid";
if [ -f $PID_FILE ]; then
kill -9 `cat $PID_FILE` 2>/dev/null && echo "killed" || (echo "fail"; exit 1);
else
echo "already";
fi;
rm $PID_FILE >/dev/null 2>&1;
echo -ne " * Kill backup loop..........";
rm $ROOT/backuploop 2>/dev/null && echo "killed" || (echo "fail"; exit 1);