summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2022-07-28 18:18:12 +0200
committerErich Eckner <git@eckner.net>2022-07-28 18:18:12 +0200
commit221f46e26ec6df7decc76f394bdc92d537f7df7d (patch)
tree13ebaab3ab36bd85dd0b9dd0201db7df556e98f9
parent36c7be42b6f8d84442b92fb2fc7b857aaf14af57 (diff)
downloadraspi-lights-out-221f46e26ec6df7decc76f394bdc92d537f7df7d.tar.xz
remove colocation stuff - it's in its own program now
-rw-r--r--.gitignore2
-rw-r--r--Makefile4
-rw-r--r--lights-out-colocation-update.service.in8
-rw-r--r--lights-out-colocation-update.timer.in10
-rw-r--r--lights-out.conf2
-rw-r--r--lights-out.in23
6 files changed, 2 insertions, 47 deletions
diff --git a/.gitignore b/.gitignore
index 5c949d4..b9bf5ae 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,4 @@
index.php
-lights-out-colocation-update.service
-lights-out-colocation-update.timer
lights-out-init.service
lights-out
lights-out@.service
diff --git a/Makefile b/Makefile
index d4c6376..8db584f 100644
--- a/Makefile
+++ b/Makefile
@@ -28,7 +28,7 @@ HTTPDIR = /srv/http/lights-out
VERSION = 0.3.1
-all: index.php lights-out lights-out-init.service lights-out@.service lights-out-colocation-update.service lights-out-colocation-update.timer
+all: index.php lights-out lights-out-init.service lights-out@.service
%: %.in
sed " \
@@ -43,7 +43,7 @@ all: index.php lights-out lights-out-init.service lights-out@.service lights-out
install: all
install -D -m0755 -t $(DESTDIR)$(BINDIR) lights-out
- install -D -m0644 -t $(DESTDIR)$(LIBDIR)/systemd/system lights-out@.service lights-out-init.service lights-out-colocation-update.service lights-out-colocation-update.timer
+ install -D -m0644 -t $(DESTDIR)$(LIBDIR)/systemd/system lights-out@.service lights-out-init.service
install -D -m0644 -t $(DESTDIR)$(ETCDIR) lights-out.conf
install -D -m0644 -t $(DESTDIR)$(HTTPDIR)/httpdocs index.php
install -D -m0600 -o http -g http /dev/null $(DESTDIR)$(HTTPDIR)/password
diff --git a/lights-out-colocation-update.service.in b/lights-out-colocation-update.service.in
deleted file mode 100644
index 9491eb4..0000000
--- a/lights-out-colocation-update.service.in
+++ /dev/null
@@ -1,8 +0,0 @@
-[Unit]
-Description=lights out update colocation
-Needs=lights-out-init.service
-After=lights-out-init.service
-
-[Service]
-Type=oneshot
-ExecStart=#BINDIR#/lights-out colocation update
diff --git a/lights-out-colocation-update.timer.in b/lights-out-colocation-update.timer.in
deleted file mode 100644
index c89370f..0000000
--- a/lights-out-colocation-update.timer.in
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=update colocation every few minutes
-
-[Timer]
-OnCalendar=*:00/10:00
-RandomizedDelaySec=600
-FixedRandomDelay=True
-
-[Install]
-WantedBy=timers.target
diff --git a/lights-out.conf b/lights-out.conf
index 250ddb6..7f6dc9e 100644
--- a/lights-out.conf
+++ b/lights-out.conf
@@ -1,8 +1,6 @@
#!/hint/bash
server='fenster'
-colocation_server="${server}"
-colocation_key='deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef'
inputs['power']=7
inputs['hdd']=15
diff --git a/lights-out.in b/lights-out.in
index ebed1eb..2071487 100644
--- a/lights-out.in
+++ b/lights-out.in
@@ -10,7 +10,6 @@ display_help() {
>&2 printf ' lights-out name: print the name of the server\n'
>&2 printf ' lights-out push $output $time: simulate push on $output for $time seconds\n'
>&2 printf ' lights-out turn on: turn on machine if not yet running\n'
- >&2 printf ' lights-out update colocation: update server state on colocation\n'
}
check_argument_count() {
@@ -123,28 +122,6 @@ case "$1" in
check_argument_count 1 "$@"
"$0" 'turn' 'on' || exit $?
;;
- 'update')
- if [ $# -ne 2 ] \
- || [ "x$2" != 'xcolocation' ]; then
- >&2 printf 'unknown command "%s"\n\n' "$*"
- display_help
- exit 1
- fi
- power=$(
- "$0" get power
- ) || exit $?
- if [ ${power} -eq 1 ] \
- && ping -c1 "${server}" 2>&1 >/dev/null; then
- ping=1
- else
- ping=0
- fi
- curl -Ss "https://colocation.eckner.net/update.php?machine=${colocation_server}&key=${colocation_key}&power=${power}&ping=${ping}" || exit $?
- ;;
- 'update colocation')
- check_argument_count 1 "$@"
- "$0" 'update' 'colocation' || exit $?
- ;;
*)
>&2 printf 'unknown command "%s"\n\n' "$1"
display_help