Answer the question
In order to leave comments, you need to log in
How to make a script for init.d?
The second day I suffer in an attempt to kill chrome before rebooting / shutting down normally, so that it does not lose the tabs.
What I did: created a file /usr/local/sbin/killchrome (chmod +x of course) with the content:
#!/bin/bash
killall chrome
sleep 5
#!/bin/sh
### BEGIN INIT INFO
# Provides: newkillchrome
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 0 6
# Default-Stop:
# Short-Description: Kill all chrome proccesses
placed in /etc/init.d
### END INIT INFO
# Source function library.
if [ -f /etc/init.d/functions ] ; then
. /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ] ; then
. /etc/rc.d/init.d/functions
else
exit 0
fi
KIND="newkillchrome"
start() {
echo -n $"Starting $KIND services: "
sh /usr/local/sbin/killchrome
}
stop() {
}
restart() {
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question