Skip to content
Snippets Groups Projects
Commit 6dfa3a8f authored by alex kuklin's avatar alex kuklin
Browse files

scripts back and cert generation

parent 5b8d4edf
No related branches found
No related tags found
2 merge requests!21scripts back and cert generation,!15WIP: Master
......@@ -4,3 +4,4 @@ Gopkg.lock
.idea/
.project
config.yaml
cert/
#!/bin/bash
PIDFILE="$HOME/tmp/key-storage-agent.pid"
kill -9 `cat $PIDFILE`
run.sh 0 → 100755
#!/bin/bash
[ -d cert ] || mkdir cert
openssl genrsa -out cert/server.key 2048
openssl req -new -key cert/server.key -out cert/server.csr -subj "/CN=localhost"
openssl x509 -req -days 365 -in cert/server.csr -signkey cert/server.key -out cert/server.crt
mkdir -p "$HOME/tmp"
PIDFILE="$HOME/tmp/key-storage-agent.pid"
if [ -e "${PIDFILE}" ] && (ps -u $(whoami) -opid= |
grep -P "^\s*$(cat ${PIDFILE})$" &> /dev/null); then
echo "Already running."
exit 99
fi
PATH=$PATH:/usr/local/bin
nohup $GOPATH/src/code.vereign.com/code/key-storage-agent/bin/server --cert-dir $GOPATH/src/code.vereign.com/code/key-storage-agent/cert > $HOME/key-storage-agent.log 2>&1 &
echo $! > "${PIDFILE}"
chmod 644 "${PIDFILE}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment