Files
mailnag/mailnag
2011-05-29 15:59:11 +02:00

29 lines
516 B
Bash
Executable File

#!/bin/bash
CONFIG_HOME=$XDG_CONFIG_HOME
if [ "$CONFIG_HOME" == "" ]; then
CONFIG_HOME="$HOME/.config"
fi
config_dir="$CONFIG_HOME/mailnag"
main()
{
if [ -f "$config_dir/mailnag.log" ]; then
rm "$config_dir/mailnag.log"
fi
cd $(dirname $(readlink -f $0))
python mailnag.py autostarted >> "$config_dir/mailnag.log" 2>&1 &
}
connection()
{
trap "exit 1" SIGTERM
while ! ping -c1 www.google.com 2>/dev/null 1>&2
do
sleep 4.2 # The answer to life, the universe and everything :-)
done
kill %-
}
connection
main