Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proper init.d script #2

Open
lakinduakash opened this issue Oct 6, 2020 · 1 comment
Open

Add proper init.d script #2

lakinduakash opened this issue Oct 6, 2020 · 1 comment

Comments

@lakinduakash
Copy link
Owner

The current init.d script is not working properly

@graynada
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants