summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYour Name <you@example.com>2013-02-14 12:14:07 +0000
committerYour Name <you@example.com>2013-02-14 12:14:07 +0000
commit95b7ed88ea2ffea100ed558e71cea1d3ff86ab96 (patch)
treed58cd06db30761b375533dc267fbfe8caa197414
parent4d72f073e0274949e85472b6e528be8209025887 (diff)
parent62b197ea0604cf9d785bf67eefcf7be00daa92b9 (diff)
Merge branch 'master' of https://github.com/krebscode/painload
-rw-r--r--services/Makefile5
-rwxr-xr-xservices/bin/update-services-pubkeys5
2 files changed, 9 insertions, 1 deletions
diff --git a/services/Makefile b/services/Makefile
index 37931f47..a4db7df1 100644
--- a/services/Makefile
+++ b/services/Makefile
@@ -7,7 +7,8 @@ export services_home := /opt/services
.PHONY: authorized_keys
-service-user: $(services_home)/services.txt $(services_home)/.ssh/authorized_keys
+
+service-user: $(services_home)/services.txt ssh_authorized_keys
@echo 'also make sure that the user is created: make create-service-user'
create-service-user:
@@ -15,6 +16,8 @@ create-service-user:
rmdir $(services_home)
useradd -m -r -l -f -1 -d $(services_home) services
+ssh_authorized_keys: $(services_home)/.ssh/authorized_keys
+
$(services_home)/.ssh:
mkdir $@
chown services:services $@
diff --git a/services/bin/update-services-pubkeys b/services/bin/update-services-pubkeys
new file mode 100755
index 00000000..6a658607
--- /dev/null
+++ b/services/bin/update-services-pubkeys
@@ -0,0 +1,5 @@
+#!/bin/sh
+KREBS_ROOT="${KREBS_ROOT:-/krebs}"
+ssh $1 <<EOF
+sh -eufc "cd $KREBS_ROOT;git pull origin master;make -C $KREBS_ROOT/services ssh_authorized_keys"
+EOF