Add new tools to interract with admin api
This commit is contained in:
parent
1ab421757b
commit
0dcf620429
|
@ -46,4 +46,5 @@ ENV HAPPYDNS_LEVELDB_PATH=/data/happydns.db
|
|||
|
||||
VOLUME /data
|
||||
|
||||
COPY --from=gobuild /go/src/git.happydns.org/happydns/happydns /usr/sbin/happydns
|
||||
COPY --from=gobuild /go/src/git.happydns.org/happydns/happydns /usr/sbin/happydns
|
||||
COPY hadmin.sh /usr/bin/hadmin
|
||||
|
|
|
@ -8,4 +8,5 @@ ENV HAPPYDNS_LEVELDB_PATH=/data/happydns.db
|
|||
|
||||
VOLUME /data
|
||||
|
||||
COPY happydns /usr/sbin/happydns
|
||||
COPY happydns /usr/sbin/happydns
|
||||
COPY hadmin.sh /usr/bin/hadmin
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/sh
|
||||
|
||||
[ -z "${HAPPYDNS_SOCKET}" ] &&
|
||||
DEST="./happydns.sock" ||
|
||||
DEST="${HAPPYDNS_SOCKET}"
|
||||
|
||||
[ -S "${DEST}" ] && DEST="--unix-socket $DEST http://localhost"
|
||||
|
||||
RET=$(curl -s ${DEST}"$@")
|
||||
CODE=$?
|
||||
|
||||
echo "$RET" | jq . 2> /dev/null ||
|
||||
echo "$RET"
|
||||
|
||||
exit $CODE
|
Loading…
Reference in New Issue