2017-05-08 17:43:31 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2017-11-16 12:30:41 -06:00
|
|
|
TEAMD_CONF_PATH=/etc/teamd
|
|
|
|
|
|
|
|
function start_app {
|
|
|
|
rm -f /var/run/teamd/*
|
|
|
|
if [ "$(ls -A $TEAMD_CONF_PATH)" ]; then
|
|
|
|
for f in $TEAMD_CONF_PATH/*; do
|
|
|
|
teamd -f $f -d
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
teamsyncd &
|
|
|
|
}
|
2017-05-08 17:43:31 -05:00
|
|
|
|
|
|
|
function clean_up {
|
2017-11-16 12:30:41 -06:00
|
|
|
if [ "$(ls -A $TEAMD_CONF_PATH)" ]; then
|
|
|
|
for f in $TEAMD_CONF_PATH/*; do
|
|
|
|
teamd -f $f -k
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
pkill -9 teamsyncd
|
|
|
|
exit
|
2017-05-08 17:43:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
trap clean_up SIGTERM SIGKILL
|
|
|
|
|
2017-11-16 12:30:41 -06:00
|
|
|
start_app
|
|
|
|
read
|