diff options
-rw-r--r-- | assets/README | 15 | ||||
-rwxr-xr-x | assets/bin/asq | 22 | ||||
-rwxr-xr-x | assets/bin/fast | 20 | ||||
-rwxr-xr-x | assets/bin/truth2json | 2 | ||||
-rw-r--r-- | streams/Makefile | 8 |
5 files changed, 38 insertions, 29 deletions
diff --git a/assets/README b/assets/README index f1875194..7f90bfbf 100644 --- a/assets/README +++ b/assets/README @@ -21,17 +21,20 @@ Example: ass set bob-pc owner bob ass set bob-pc location bob\'s-home -### asq (ass-quick) -asq is a wrapper around the core ass. It should be used for adding lots and lots of new entries to the truth. It evaluates Variables from your environment. +### asq +asq is a tool to query the truth for facts. This is currently only a placeholder + +### FAST +fast is a wrapper around the core ass. It should be used for adding lots and lots of new entries to the truth. It evaluates Variables from your environment. Example: export ASS_LOCATION=bob\'s-home export ASS_OWNER=bob - asq c logitech-sidewinder-gamepad - asq c arduino-uno - asq s amount 3 + fast c logitech-sidewinder-gamepad + fast c arduino-uno + fast s amount 3 -asq will then actually generate the following: +fast will then actually generate the following: ass create logitech-sidewinder-gamepad ass set logitech-sidewinder-gamepad owner bob ass set logitech-sidewinder-gamepad location bob\'s-home diff --git a/assets/bin/asq b/assets/bin/asq index 41725d0b..0204e05b 100755 --- a/assets/bin/asq +++ b/assets/bin/asq @@ -1,20 +1,2 @@ -#!/bin/bash -set -xeuf -cd $(dirname $(readlink -f $0)) - -if [ "$1" == "c" ];then - ./ass create "$2" && export ASS_CREATED="$2" - for i in `env | grep -v '^ASS_CREATED=' | grep "^ASS" | cut -d '=' -f 1`;do - e=`echo $i | cut -d '_' -f 2 | tr '[A-Z]' '[a-z]'` - eval con=\$$i - $0 s "$e" "$con" - done -else if [ "$1" == "s" ] -then - ./ass set "${ASS_CREATED}" "${2}" "${3}" - else - echo "you are made of stupid!" - cat $0 - exit 23 - fi -fi +#!/bin/something +# placeholder to asq the truth for facts diff --git a/assets/bin/fast b/assets/bin/fast new file mode 100755 index 00000000..41725d0b --- /dev/null +++ b/assets/bin/fast @@ -0,0 +1,20 @@ +#!/bin/bash +set -xeuf +cd $(dirname $(readlink -f $0)) + +if [ "$1" == "c" ];then + ./ass create "$2" && export ASS_CREATED="$2" + for i in `env | grep -v '^ASS_CREATED=' | grep "^ASS" | cut -d '=' -f 1`;do + e=`echo $i | cut -d '_' -f 2 | tr '[A-Z]' '[a-z]'` + eval con=\$$i + $0 s "$e" "$con" + done +else if [ "$1" == "s" ] +then + ./ass set "${ASS_CREATED}" "${2}" "${3}" + else + echo "you are made of stupid!" + cat $0 + exit 23 + fi +fi diff --git a/assets/bin/truth2json b/assets/bin/truth2json index 53af7dc8..f85445b4 100755 --- a/assets/bin/truth2json +++ b/assets/bin/truth2json @@ -5,7 +5,7 @@ import sys try: db=sys.argv[1] except: - db="/krebs/db/truth" + db="../../db/truth" ret = {} diff --git a/streams/Makefile b/streams/Makefile index 209eb656..ab5d1429 100644 --- a/streams/Makefile +++ b/streams/Makefile @@ -1,12 +1,16 @@ INITD = $(shell test -e /etc/rc.d/ && echo /etc/rc.d/ || echo /etc/init.d/) streams = $(shell cut -d\ -f2 stream.db) + + CURRDIR = ${PWD} .PHONY: all $(streams) +local: ../bin/streams +../bin/streams: + ln -sf $$PWD/streams ../bin/streams all: $(streams) @update-rc.d groove defaults 2>/dev/null || echo "[31;1m**[31;1;5m put groove daemon in DAEMONS in /etc/rc.conf[m" -$(streams): +$(streams): local @test -L $(INITD)$@ || test ! -e $(INITD)$@ && \ ln -n -s -f $$PWD/stream-starter $(INITD)$@ && echo "writing $@ to $(INITD)" - ln -sf $$PWD/streams ../bin/streams |