Skip to content

Commit

Permalink
make install.sh actually work
Browse files Browse the repository at this point in the history
  • Loading branch information
sfomuseumbot committed Jun 20, 2019
1 parent f896ff9 commit 2f07b2c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ tools:

docker:
docker build -t go-pubssed .

install:
sudo systemd/install.sh
15 changes: 5 additions & 10 deletions systemd/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 -

Expand All @@ -54,6 +47,8 @@ do

SERVICE_FNAME=`basename ${SERVICE}`

echo ${SERVICE_FNAME}

if [ -f ${SERVICE} ]
then
cp ${SYSTEMD}/${SERVICE_FNAME}.example ${SERVICE}
Expand Down

0 comments on commit 2f07b2c

Please sign in to comment.