From 66763dab98ae75c60661f656c5230cc6365f51a3 Mon Sep 17 00:00:00 2001 From: Aaron Ball Date: Sun, 24 Dec 2017 13:46:53 -0700 Subject: Initial commit of init script This script just sets the permissions on the brightness file so it is writable by all users on the system. This allows users to run luminous without the need to be root. On start, this script sets brightness to 666. On stop, sets brightness file permissions to 644. --- init.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 init.sh diff --git a/init.sh b/init.sh new file mode 100755 index 0000000..6105698 --- /dev/null +++ b/init.sh @@ -0,0 +1,17 @@ +#!/bin/sh +# +# start/stop luminous setup +# +# This only sets the permissions on the brightness + +case $1 in + start) + chmod 666 /sys/class/backlight/*/brightness + ;; + stop) + chmod 644 /sys/class/backlight/*/brightness + ;; + *) + printf "usage: $0 [start|stop]\n" + ;; +esac -- cgit v1.2.3 From c2927f0e4083ac07dff21c4af1e315417128fc1e Mon Sep 17 00:00:00 2001 From: Aaron Ball Date: Sun, 24 Dec 2017 13:56:09 -0700 Subject: Updated makefile for init script Now the init script is deployed on make install. Also fixed DESTDIR and added BINDIR variable. --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f5f6b74..f4b2ef8 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,15 @@ out=luminous CCOPTS=-Wall -DESTDIR=/usr/bin + +BINDIR=/usr/bin +INITDIR=/etc/rc.d all: cc $(CCOPTS) $(DBG) src/main.c -o luminous install: - install -D luminous ${DESTDIR}/luminous + install -D luminous ${DESTDIR}/${BINDIR}/luminous + install -D init.sh ${DESTDIR}/${INITDIR}/luminous debug: make DBG=-g -- cgit v1.2.3