lakinduakash/asus-screenpad-control

Add proper init.d script

Opened this issue · 1 comments

The current init.d script is not working properly

For anyone else it may help I have made the following init.d

#!/bin/bash
### BEGIN INIT INFO
# Provides:          asus-screenpad-permission-update
# Required-Start:
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:
# Short-Description: Screenpad brightness permissions
# Description: Sets permissions ro enable screenpad brightness
### END INIT INFO

# Source function library.
. /lib/lsb/init-functions

start() {
    # code to start app comes here 
    # example: daemon program_name &
    /usr/bin/chmod a+w '/sys/class/leds/asus::screenpad/brightness'
    echo "asus-screenpad-permissions-update start"
}

stop() {
    # code to stop app comes here 
    # example: killproc program_name
    echo "asus-screenpad-permissions-update stop"
}

case "$1" in 
    start)
       start
       ;;
    stop)
       stop
       ;;
    restart)
       stop
       start
       ;;
    status)
       # code to check status of app comes here 
       # example: status program_name
       ;;
    *)
       echo "Usage: $0 {start|stop|status|restart}"
esac

exit 0 

and registered with (debian and derivatives)

sudo update-rc.d asus-screenpad-permission-update defaults