From 2f07b2c5515bedf1edb5267741354e0a004d9604 Mon Sep 17 00:00:00 2001 From: "aaron.cope" Date: Thu, 20 Jun 2019 16:38:25 +0000 Subject: [PATCH] make install.sh actually work --- Makefile | 3 +++ systemd/install.sh | 15 +++++---------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 041c31b..2986b10 100644 --- a/Makefile +++ b/Makefile @@ -5,3 +5,6 @@ tools: docker: docker build -t go-pubssed . + +install: + sudo systemd/install.sh diff --git a/systemd/install.sh b/systemd/install.sh index 4fcf8fe..efaaf20 100755 --- a/systemd/install.sh +++ b/systemd/install.sh @@ -20,12 +20,12 @@ fi WHOAMI=`${PYTHON} -c 'import os, sys; print os.path.realpath(sys.argv[1])' $0` SYSTEMD=`dirname ${WHOAMI}` -GO_SWIM=`dirname ${SYSTEMD}` +GO_PUBSSED=`dirname ${SYSTEMD}` USER="pubssed" GROUP="pubssed" -PUBBSED_SERVICE="/lib/systemd/system/pubssed-server.service" +PUBSSED_SERVICE="/lib/systemd/system/pubssed-server.service" if [ "$EUID" -ne 0 ] then echo "Please run as root" @@ -38,14 +38,7 @@ else useradd ${USER} -s /sbin/nologin -M fi -if [ ! -d /usr/local/etc/swim ] -then - mkdir -p /usr/local/etc/swim - chown swim /usr/local/etc/swim - chmod 700 /usr/local/etc/swim -fi - -cd ${GO_SWIM} +cd ${GO_PUBSSED} ${GOLANG} build -mod vendor -o /usr/local/bin/pubssed-server cmd/pubssed-server/main.go cd - @@ -54,6 +47,8 @@ do SERVICE_FNAME=`basename ${SERVICE}` + echo ${SERVICE_FNAME} + if [ -f ${SERVICE} ] then cp ${SYSTEMD}/${SERVICE_FNAME}.example ${SERVICE}