From 221f46e26ec6df7decc76f394bdc92d537f7df7d Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 28 Jul 2022 18:18:12 +0200 Subject: remove colocation stuff - it's in its own program now --- .gitignore | 2 -- Makefile | 4 ++-- lights-out-colocation-update.service.in | 8 -------- lights-out-colocation-update.timer.in | 10 ---------- lights-out.conf | 2 -- lights-out.in | 23 ----------------------- 6 files changed, 2 insertions(+), 47 deletions(-) delete mode 100644 lights-out-colocation-update.service.in delete mode 100644 lights-out-colocation-update.timer.in 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 -- cgit v1.2.3-54-g00ecf