2021-01-09 09:58:56 -05:00
|
|
|
import logging
|
|
|
|
|
|
|
|
import aprsd
|
2024-04-01 21:46:23 -04:00
|
|
|
from aprsd import plugin
|
|
|
|
from aprsd.stats import collector
|
2021-01-09 09:58:56 -05:00
|
|
|
|
2021-08-23 12:14:19 -04:00
|
|
|
|
2021-01-09 09:58:56 -05:00
|
|
|
LOG = logging.getLogger("APRSD")
|
|
|
|
|
|
|
|
|
2021-08-19 11:39:29 -04:00
|
|
|
class VersionPlugin(plugin.APRSDRegexCommandPluginBase):
|
2021-01-09 09:58:56 -05:00
|
|
|
"""Version of APRSD Plugin."""
|
|
|
|
|
2022-12-29 14:18:38 -05:00
|
|
|
command_regex = r"^([v]|[v]\s|version)"
|
2021-01-09 09:58:56 -05:00
|
|
|
command_name = "version"
|
2021-11-12 11:36:22 -05:00
|
|
|
short_description = "What is the APRSD Version"
|
2021-01-09 09:58:56 -05:00
|
|
|
|
|
|
|
# message_number:time combos so we don't resend the same email in
|
|
|
|
# five mins {int:int}
|
|
|
|
email_sent_dict = {}
|
|
|
|
|
2021-08-19 11:39:29 -04:00
|
|
|
def process(self, packet):
|
2021-01-09 09:58:56 -05:00
|
|
|
LOG.info("Version COMMAND")
|
2021-07-14 20:50:41 -04:00
|
|
|
# fromcall = packet.get("from")
|
|
|
|
# message = packet.get("message_text", None)
|
|
|
|
# ack = packet.get("msgNo", "0")
|
2024-04-01 21:46:23 -04:00
|
|
|
s = collector.Collector().collect()
|
2021-04-02 18:54:00 -04:00
|
|
|
return "APRSD ver:{} uptime:{}".format(
|
|
|
|
aprsd.__version__,
|
2024-04-01 21:46:23 -04:00
|
|
|
s["APRSDStats"]["uptime"],
|
2021-04-02 18:54:00 -04:00
|
|
|
)
|