add configuration check script between current brisk.conf.pho file and the official...
authorMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Wed, 20 Nov 2013 20:06:17 +0000 (21:06 +0100)
committerMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Wed, 20 Nov 2013 20:06:45 +0000 (21:06 +0100)
TODO.txt
bin/conf_check.sh [new file with mode: 0755]
web/Obj/brisk.conf-templ.pho

index 3f4974f..e18ee0c 100644 (file)
--- a/TODO.txt
+++ b/TODO.txt
@@ -10,7 +10,8 @@
        . show licence ([show me later, yes, no]/[yes, no])
        . switch-off date
        . opt - button on when arrived to the bottom of the licence
-
+       . opt - download licence
+       . min - check licence version between config file and licence file
      . show guaranteer
 
      . email validation
diff --git a/bin/conf_check.sh b/bin/conf_check.sh
new file mode 100755 (executable)
index 0000000..708c63c
--- /dev/null
@@ -0,0 +1,43 @@
+#!/bin/bash
+CONFFILE=$HOME/.brisk_install
+
+webbase_get () {
+    local p="$1"
+    while [ "$p" ]; do
+        if [ -d "${p}/Etc" ]; then
+            echo "${p}/Etc"
+            return 0
+        fi
+        if [ "$p" = "/" ]; then
+            return 1
+        fi
+        p="$(dirname "$p")"
+    done
+}
+
+if [ -f "$CONFFILE" ]; then
+    source "$CONFFILE"
+else
+    echo "$CONFFILE not found"
+    exit 1
+fi
+
+WEBBASE="$(webbase_get "$web_path")"
+if [ $? -ne 0 ]; then
+    echo "Etc directory not found"
+    return 1
+fi
+
+BRISKCONF="${WEBBASE}/brisk.conf.pho"
+if [ ! -f "$BRISKCONF" ]; then
+    echo "$BRISKCONF not found"
+    exit 2
+fi
+echo "Check $BRISKCONF with web/Obj/brisk.conf-templ.pho ... " | tr -d '\n'
+diff -u <(sed 's/ *=.*//g' web/Obj/brisk.conf-templ.pho | grep -v '^[  ]*//' | sort) <(sed 's/ *=.*//g' "$BRISKCONF" | grep -v '^[     ]*//' | sort)
+if [ $? -eq 0 ]; then
+    echo "vars match."
+fi
+
+
index 6b38d24..a258855 100644 (file)
@@ -7,6 +7,8 @@ $G_dbpfx = "bsk_";
 
 $G_lang = "it";
 
+$G_crypt_key = "cryptkey";
+
 $G_shutdown = FALSE;
 
 // list of allowed proxies IP address (strings)