2020-02-14 23:16:04 +00:00
|
|
|
#!/usr/bin/python3
|
2015-08-17 18:32:58 +00:00
|
|
|
"""
|
|
|
|
|
2017-05-02 13:17:50 +00:00
|
|
|
This file is part of OpenWebRX,
|
|
|
|
an open-source SDR receiver software with a web UI.
|
|
|
|
Copyright (c) 2013-2015 by Andras Retzler <randras@sdr.hu>
|
2020-02-16 10:49:20 +00:00
|
|
|
Copyright (c) 2019-2020 by Jakob Ketterl <dd5jfk@darc.de>
|
2015-08-17 18:32:58 +00:00
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Affero General Public License as
|
|
|
|
published by the Free Software Foundation, either version 3 of the
|
|
|
|
License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
2019-05-12 12:35:25 +00:00
|
|
|
from owrx.sdrhu import SdrHuUpdater
|
2020-03-21 21:40:39 +00:00
|
|
|
from owrx.config import Config
|
2015-08-17 18:32:58 +00:00
|
|
|
|
2020-02-14 23:16:04 +00:00
|
|
|
import logging
|
|
|
|
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
2019-07-21 17:40:28 +00:00
|
|
|
if __name__ == "__main__":
|
2020-03-21 21:40:39 +00:00
|
|
|
pm = Config.get()
|
2019-05-12 12:35:25 +00:00
|
|
|
|
2020-02-14 23:16:04 +00:00
|
|
|
if "sdrhu_public_listing" not in pm or not pm["sdrhu_public_listing"]:
|
|
|
|
logger.error('Public listing on sdr.hu is not activated. Please check "sdrhu_public_listing" in your config.')
|
|
|
|
exit(1)
|
|
|
|
if "sdrhu_key" not in pm or pm["sdrhu_key"] is None or pm["sdrhu_key"] == "":
|
|
|
|
logger.error('Missing "sdrhu_key" in your config. Aborting')
|
2019-05-12 12:35:25 +00:00
|
|
|
exit(1)
|
|
|
|
SdrHuUpdater().update()
|