Browse Source

unignore Commands

adri 3 weeks ago
parent
commit
4f61a79ad5

+ 0 - 1
.gitignore

@@ -1,5 +1,4 @@
 .env
-Commands/
 *.bak
 Masks/
 Media/

+ 2 - 0
Commands/Alerts Off.bat

@@ -0,0 +1,2 @@
+REM ispy-internal
+ALERTOFF

+ 2 - 0
Commands/Alerts On.bat

@@ -0,0 +1,2 @@
+REM ispy-internal
+ALERTON

+ 2 - 0
Commands/All Off.bat

@@ -0,0 +1,2 @@
+REM ispy-internal
+ALLOFF

+ 2 - 0
Commands/All On.bat

@@ -0,0 +1,2 @@
+REM ispy-internal
+ALLON

+ 2 - 0
Commands/Apply Schedule.bat

@@ -0,0 +1,2 @@
+REM ispy-internal
+APPLYSCHEDULE

+ 2 - 0
Commands/Record Off.bat

@@ -0,0 +1,2 @@
+REM ispy-internal
+RECORDINGOFF

+ 2 - 0
Commands/Record on Alert.bat

@@ -0,0 +1,2 @@
+REM ispy-internal
+RECORDONALERTON

+ 2 - 0
Commands/Record on Detect.bat

@@ -0,0 +1,2 @@
+REM ispy-internal
+RECORDONDETECTON

+ 2 - 0
Commands/Restart Agent.bat

@@ -0,0 +1,2 @@
+REM ispy-internal
+RESTART

+ 2 - 0
Commands/Run Storage Mgmt.bat

@@ -0,0 +1,2 @@
+REM ispy-internal
+RUNSTORAGEMGMT

+ 2 - 0
Commands/Snapshot.bat

@@ -0,0 +1,2 @@
+REM ispy-internal
+SNAPSHOT

+ 2 - 0
Commands/Start Record.bat

@@ -0,0 +1,2 @@
+REM ispy-internal
+RECORD

+ 2 - 0
Commands/Stop Cloud Uploads.bat

@@ -0,0 +1,2 @@
+REM ispy-internal
+STOPCLOUDUPLOADS

+ 2 - 0
Commands/Stop Record.bat

@@ -0,0 +1,2 @@
+REM ispy-internal
+RECORDSTOP

+ 2 - 0
Commands/Stop Streaming.bat

@@ -0,0 +1,2 @@
+REM ispy-internal
+RTMPSTOP

+ 2 - 0
Commands/_Example.bat

@@ -0,0 +1,2 @@
+REM ispy-internal
+BROADCAST 'Example command - see Commands/readme.txt to add your own'

+ 3 - 0
Commands/fix_archive_perms.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+find /mnt/rshare/agent-archive -type d -exec chmod og+rwx '{}' \;
+find /mnt/rshare/agent-archive -type f -exec chmod og+rw '{}' \;

+ 49 - 0
Commands/readme.txt

@@ -0,0 +1,49 @@
+To add your own commands to the list create a new file in the Commands directory
+
+You can execute internal commands by adding a new .bat file and adding a remark at the top of the file. For example to switch all internal cameras off and start recording all external cameras you could do:
+
+
+REM ispy-internal
+switchon&group=external
+switchoff&group=internal
+RECORD
+BROADCAST 'external cameras are on and recording'
+
+(This uses groups - so you'd need to setup your internal/ external cameras with group names on the general tab when you edit them )
+
+list of available commands:
+
+allon
+alloff
+applyschedule
+stopclouduploads
+recordondetecton
+recordonalerton
+recordingoff
+record
+recordstop
+alerton
+alertoff
+snapshot
+alert
+switchon
+switchoff
+
+more: https://www.ispyconnect.com/docs/agent/api
+
+
+You can use these commands on their own, with a group or by passing in an object type and and object id:
+
+-- specify ot=2 for a camera or ot=1 for a microphone and pass in an object id - you can find the object id (oid) on the server object list on the web portal (second column).
+switchon&ot=2&oid=1 
+
+-- specify a group name
+switchon&group=garage
+
+-- apply to all objects
+switchon
+
+To run an executable file say to open a garage door or something you'd leave off the REM ispy-internal command and just create a regular .bat (or .sh on linux/ osx) file like
+
+start "c:\program files\acme garage door" opensesame.exe
+

+ 9 - 0
Commands/save_summary.sh

@@ -0,0 +1,9 @@
+#!/bin/bash
+
+# Escape arguments
+id=$(sqlite3 :memory: <<< ".shell echo '$1'")
+file=$(sqlite3 :memory: <<< ".shell echo '$2'")
+summary=$(sqlite3 :memory: <<< ".shell echo '$3'")
+
+# Insert the row
+sqlite3 /agent/Media/XML/fileDB.db3 "INSERT INTO AgentSummary (id, file, summary) VALUES ('$id', '$file', '$summary');"