Skip to content
This repository has been archived by the owner on Jan 21, 2021. It is now read-only.

Commit

Permalink
🚑 Typo: precense -> presence
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck committed May 19, 2018
1 parent 2bccb52 commit 922e5f8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions happy-bubbles/rootfs/etc/cont-init.d/20-persist-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ if ! hass.file_exists '/data/presence.db'; then
hass.log.debug 'Starting Presence temporarly...'

cd /opt || exit
exec 3< <(./precense)
exec 3< <(./presence)

# Wait until the db exists
until hass.file_exists "/opt/precense.db"; do
until hass.file_exists "/opt/presence.db"; do
sleep 1
done

# Just to be safe, wait another 2 seconds
sleep 2

# Kill it, if still alive
kill "$(pgrep precense)" >/dev/null 2>&1 || true
kill "$(pgrep presence)" >/dev/null 2>&1 || true

# Move the created database into a safe place
mv /opt/precense.db /data/precense.db
mv /opt/presence.db /data/presence.db

hass.log.debug 'Persistent precense database created'
hass.log.debug 'Persistent presence.db database created'
fi

ln -s /data/precense.db /opt/precense.db
ln -s /data/presence.db /opt/presence.db

0 comments on commit 922e5f8

Please sign in to comment.