We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 302db63 commit 24b585fCopy full SHA for 24b585f
addon_files/redmatic/bin/checkContext
@@ -0,0 +1,25 @@
1
+#/bin/sh
2
+
3
+ADDON_DIR=/usr/local/addons/redmatic
4
5
+source $ADDON_DIR/home/.profile
6
7
+CONTEXT_DIR="`jq -r '.contextStorage.file.config.dir' $ADDON_DIR/etc/settings.json`"
8
9
+check() {
10
+ FILE=$1
11
+ if [ -f $FILE ]; then
12
+ echo "checking $1" # | logger -p daemon.info -t redmatic
13
+ TYPE=`jq -r -e type $1 2> /dev/null`
14
+ if [ $? != 0 ] || [ -z $TYPE ] || [ $TYPE != "object" ]; then
15
+ echo "$1 corrupted." # | logger -p daemon.err -t redmatic
16
+ fi
17
18
19
20
+}
21
22
+if [ -d "$CONTEXT_DIR/context" ]; then
23
+ export check
24
+ find "$CONTEXT_DIR/context" -name \*.json | while read file; do check "$file"; done
25
+fi
0 commit comments