From 0fa554bb37efa23713707861b47c3e6e758b434d Mon Sep 17 00:00:00 2001 From: Cem Keylan Date: Wed, 13 May 2020 01:06:58 +0300 Subject: [PATCH] add poweroff script --- Makefile | 8 ++++++-- poweroff | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100755 poweroff diff --git a/Makefile b/Makefile index 8ce62b4..1fd86c2 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,11 @@ PREFIX = /usr/local BINDIR = ${PREFIX}/bin install: - install -Dm755 -t ${DESTDIR}${BINDIR} shinit + install -Dm755 shinit ${DESTDIR}${BINDIR}/shinit + install -Dm755 poweroff ${DESTDIR}${BINDIR}/poweroff + ln -sf poweroff ${DESTDIR}${BINDIR}/reboot uninstall: - rm -f ${DESTDIR}${BINDIR}/shinit + rm -f ${DESTDIR}${BINDIR}/shinit \ + ${DESTDIR}${BINDIR}/poweroff \ + ${DESTDIR}${BINDIR}/reboot diff --git a/poweroff b/poweroff new file mode 100755 index 0000000..329a5d7 --- /dev/null +++ b/poweroff @@ -0,0 +1,4 @@ +#!/bin/sh +# An example way to poweroff/reboot. + +case "${0##*/}" in poweroff) kill -s USR1 1 ;; reboot) kill -s INT 1 ; esac -- 2.45.2