summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md35
-rwxr-xr-xbmcli10
-rwxr-xr-xbmcli-wrapper35
3 files changed, 80 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..5a6a8c4
--- /dev/null
+++ b/README.md
@@ -0,0 +1,35 @@
+# pistar-Scripts
+A collection of scripts to manage various aspects of the Pi-Star system
+from the command line.
+
+IMPORTANT: These scripts are NOT supported by Pi-Star. Do not request support
+for them on the Pi-Star forums or the Pi-Star Facebook group.
+
+# System Requirements
+- Pi-Star 3.4.n
+
+# Installation
+Copy the contents of the repository somewhere useful. All scripts are
+hardcoded to be called from the same directory where they reside.
+This will be changed in the future to make them more portable.
+
+# Scripts
+The following scripts are in this package.
+
+## bmcli
+bmcli (and its associated bmcli-wapper) are command-line interfaces
+to the DMR Brandmeister API. Uses all configuration from Pi-Star and
+requires the Brandmeister API to configured in the web interface
+before using.
+
+```
+usage:
+ bmcli-wrapper.php add TALKGROUP TIMESLOT
+ bmcli-wrapper.php del TALKGROUP TIMESLOT
+ bmcli-wrapper.php dropdyn
+
+```
+
+This script has only rudimentary error checking so make sure you
+call it correctly or you could have some interesting BM configurations
+pointing to your repeater/hotspot.
diff --git a/bmcli b/bmcli
new file mode 100755
index 0000000..6bac9cb
--- /dev/null
+++ b/bmcli
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+if [ $# -lt 1 ]; then
+ ./bmcli-wrapper
+ exit 1
+else
+ ./bmcli-wrapper $* 2>&1 | \
+ grep '<tr><td>' | \
+ sed 's/<...?>//g'
+fi
diff --git a/bmcli-wrapper b/bmcli-wrapper
new file mode 100755
index 0000000..bff5031
--- /dev/null
+++ b/bmcli-wrapper
@@ -0,0 +1,35 @@
+#!/usr/bin/php
+<?php
+
+$_SERVER['DOCUMENT_ROOT'] = "/var/www/dashboard";
+
+switch($argv[1]) {
+ case "add":
+ $_POST["TGmgr"] = "ADD";
+ $_POST["tgNr"] = $argv[2];
+ $_POST["TS"] = $argv[3];
+ $_POST["tgSubmit"] = 1;
+ break;
+
+ case "del":
+ $_POST["TGmgr"] = "DEL";
+ $_POST["tgNr"] = $argv[2];
+ $_POST["TS"] = $argv[3];
+ $_POST["tgSubmit"] = 1;
+ break;
+
+ case "dropdyn":
+ $_POST["dropDyn"] = 1;
+ break;
+
+ default:
+ echo "usage:\n";
+ echo " bmcli-wrapper.php add TALKGROUP TIMESLOT\n";
+ echo " bmcli-wrapper.php del TALKGROUP TIMESLOT\n";
+ echo " bmcli-wrapper.php dropdyn\n";
+ exit;
+}
+
+include_once $_SERVER['DOCUMENT_ROOT'] . "/mmdvmhost/bm_manager.php";
+
+?>