Commit 18242fee authored by Steven Gueguen's avatar Steven Gueguen

Fix token extraction

parent 6343d7b2
...@@ -4,4 +4,4 @@ md5sum = 297c5bd36d4e6e3b646801e881f1a4bd ...@@ -4,4 +4,4 @@ md5sum = 297c5bd36d4e6e3b646801e881f1a4bd
[install-warp10.sh] [install-warp10.sh]
filename = install-warp10.sh.in filename = install-warp10.sh.in
md5sum = 0cee0cca541c0f7aa2654907258a43d8 md5sum = 15d8ec690b7fda3077e77cf6f2fe0407
...@@ -39,16 +39,15 @@ sed -i -e 's|^#warpscript.extension.sensision|warpscript.extension.sensision|g' ...@@ -39,16 +39,15 @@ sed -i -e 's|^#warpscript.extension.sensision|warpscript.extension.sensision|g'
## Generate demo tokens ## Generate demo tokens
## ##
tokens=$("${WARP10_HOME}"/bin/warp10.sh tokengen "${WARP10_HOME}/tokens/demo-tokengen.mc2" 2>/dev/null) tokens=$("${WARP10_HOME}"/bin/warp10.sh tokengen "${WARP10_HOME}/tokens/demo-tokengen.mc2" 2>/dev/null)
READ_TOKEN=$(echo "${tokens}" | grep DemoReadToken -A1 | tail -1 | sed -e 's/.*" : "//' -e 's/"//') READ_TOKEN=$(echo "${tokens}" | grep '"token"' | tail -1 | sed -e 's/.*" : "//' -e 's/".*//')
WRITE_TOKEN=$(echo "${tokens}" | grep DemoWriteToken -A1 | tail -1 | sed -e 's/.*" : "//' -e 's/"//') WRITE_TOKEN=$(echo "${tokens}" | grep '"token"' | head -1 | sed -e 's/.*" : "//' -e 's/".*//')
## ##
## Generate read/write token for sensision for a period of 100 years. We use 'sensision' as application name. ## Generate read/write token for sensision for a period of 100 years. We use 'sensision' as application name.
## Define token as MACROCONFIG key for runner script ## Define token as MACROCONFIG key for runner script
## ##
tokens=$("${WARP10_HOME}"/bin/warp10.sh tokengen "${WARP10_HOME}/tokens/sensision-tokengen.mc2" 2>/dev/null) tokens=$("${WARP10_HOME}"/bin/warp10.sh tokengen "${WARP10_HOME}/tokens/sensision-tokengen.mc2" 2>/dev/null)
SENSISION_READ_TOKEN=$(echo "${tokens}" | grep SensisionReadToken -A1 | tail -1 | sed -e 's/.*" : "//' -e 's/"//') SENSISION_READ_TOKEN=$(echo "${tokens}" | grep '"token"' | tail -1 | sed -e 's/.*" : "//' -e 's/".*//')
SENSISION_WRITE_TOKEN=$(echo "${tokens}" | grep SensisionWriteToken -A1 | tail -1 | sed -e 's/.*" : "//' -e 's/"//') SENSISION_WRITE_TOKEN=$(echo "${tokens}" | grep '"token"' | head -1 | sed -e 's/.*" : "//' -e 's/".*//')
echo "sensisionReadToken@/sensision=${SENSISION_READ_TOKEN}" >> "${WARP10_CONFIG_DIR}"/99-sensision-secrets.conf echo "sensisionReadToken@/sensision=${SENSISION_READ_TOKEN}" >> "${WARP10_CONFIG_DIR}"/99-sensision-secrets.conf
echo "sensisionWriteToken@/sensision=${SENSISION_WRITE_TOKEN}" >> "${WARP10_CONFIG_DIR}"/99-sensision-secrets.conf echo "sensisionWriteToken@/sensision=${SENSISION_WRITE_TOKEN}" >> "${WARP10_CONFIG_DIR}"/99-sensision-secrets.conf
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment