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