Merge pull request #21 from wiedehopf/master
make sure we retry forever.
This commit is contained in:
commit
e9eaf2cacc
5 changed files with 16 additions and 10 deletions
|
|
@ -11,6 +11,8 @@ ExecStart=/usr/local/share/adsbexchange/adsbexchange-feed.sh
|
|||
Type=simple
|
||||
Restart=always
|
||||
RestartSec=30
|
||||
StartLimitInterval=1
|
||||
StartLimitBurst=100
|
||||
SyslogIdentifier=adsbexchange-feed
|
||||
|
||||
[Install]
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@ INPUT_PORT=$(echo $INPUT | cut -d: -f2)
|
|||
SOURCE="--net-connector $INPUT_IP,$INPUT_PORT,beast_in"
|
||||
MLAT_IN="--net-connector localhost,30157,beast_in"
|
||||
|
||||
if ! nc -z "$INPUT_IP" "$INPUT_PORT"; then
|
||||
echo "<3>Could not connect to $INPUT_IP:$INPUT_PORT"
|
||||
exit 1
|
||||
fi
|
||||
while ! nc -z "$INPUT_IP" "$INPUT_PORT" && command -v nc &>/dev/null; do
|
||||
echo "<3>Could not connect to $INPUT_IP:$INPUT_PORT, retry in 30 seconds."
|
||||
sleep 30
|
||||
done
|
||||
|
||||
/usr/local/share/adsbexchange/feed-adsbx --net --net-only --debug=n --quiet \
|
||||
--write-json /run/adsbexchange-feed \
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ ExecStart=/usr/local/share/adsbexchange/adsbexchange-mlat.sh
|
|||
Type=simple
|
||||
Restart=always
|
||||
RestartSec=30
|
||||
StartLimitInterval=1
|
||||
StartLimitBurst=100
|
||||
SyslogIdentifier=adsbexchange-mlat
|
||||
|
||||
[Install]
|
||||
|
|
|
|||
|
|
@ -9,10 +9,11 @@ fi
|
|||
|
||||
INPUT_IP=$(echo $INPUT | cut -d: -f1)
|
||||
INPUT_PORT=$(echo $INPUT | cut -d: -f2)
|
||||
if ! nc -z "$INPUT_IP" "$INPUT_PORT"; then
|
||||
echo "<3>Could not connect to $INPUT_IP:$INPUT_PORT"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
while ! nc -z "$INPUT_IP" "$INPUT_PORT" && command -v nc &>/dev/null; do
|
||||
echo "<3>Could not connect to $INPUT_IP:$INPUT_PORT, retry in 30 seconds."
|
||||
sleep 30
|
||||
done
|
||||
|
||||
/usr/local/share/adsbexchange/venv/bin/python3 /usr/local/share/adsbexchange/venv/bin/mlat-client \
|
||||
--input-type "$INPUT_TYPE" --no-udp \
|
||||
|
|
|
|||
5
setup.sh
5
setup.sh
|
|
@ -152,9 +152,10 @@ fi
|
|||
for package in $required_packages
|
||||
do
|
||||
if [ $(dpkg-query -W -f='${STATUS}' $package 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
|
||||
if [[ $APT_UPDATED == "false" ]]; then
|
||||
apt-get update && APT_UPDATE="true"
|
||||
if [[ "$APT_UPDATED" == "false" ]]; then
|
||||
apt-get update >> $LOGFILE 2>&1 && APT_UPDATED="true"
|
||||
fi
|
||||
echo Installing $package >> $LOGFILE 2>&1
|
||||
apt-get install -y $package >> $LOGFILE 2>&1
|
||||
fi
|
||||
progress=$((progress+2))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue