Skip to content
This repository has been archived by the owner on Oct 30, 2019. It is now read-only.

DuckDNS: Add remove function. #188

Merged
merged 3 commits into from
Oct 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/duckdns.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ Before running this script you should already have an Duck DNS account, during t
$ sudo hassbian-config install duckdns
```

# Remove
```bash
sudo hassbian-config remove duckdns
```

## Additional info
Running as: `homeassistant`

Expand Down
14 changes: 14 additions & 0 deletions package/opt/hassbian/suites/duckdns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,18 @@ fi
return 0
}

function duckdns-remove-package {
echo "Removing certificates if installed."
rm -R /home/homeassistant/dehydrated >/dev/null 2>&1

echo "Removing cron jobs"
rm /etc/cron.daily/dehydrated >/dev/null 2>&1
crontab -u homeassistant -l | grep -v 'duck.sh' | crontab -u homeassistant -

echo
echo -e "\\e[32mRemoval done..\\e[0m"
echo
return 0
}

[[ "$_" == "$0" ]] && echo "hassbian-config helper script; do not run directly, use hassbian-config instead"