packages:userscripts
This is an old revision of the document!
rc-scripts-user allows users to run scripts at system startup and shutdown.
Create ~/.config/init.d/script_name. It must accept one argument, it will be either “start” or “stop”.
Example ~/.config/init.d/irssi
#!/bin/sh # download fifo_remote.pl irssi script to control it remotelly REMOTE="$HOME/.irssi/remote-control" install_fifo_remote() { install -d ~/.irssi/scripts/autorun cd ~/.irssi/scripts wget http://ep09.pld-linux.org/~sparky/fifo_remote.pl cd autorun ln -s ../fifo_remote.pl . rm $REMOTE mkfifo $REMOTE chmod 600 $REMOTE } case "$1" in start) [ -p "$REMOTE" ] || install_fifo_remote if ! pidof irssi > /dev/null; then screen -d -m -S irssi irssi fi ;; stop) pidof irssi > /dev/null || exit 0 echo "quit System shutdown" > $REMOTE usleep 10000 if pidof irssi > /dev/null; then sleep 1 killall -INT irssi fi ;; install) install_fifo_remote ;; esac
packages/userscripts.1296580369.txt.gz · Last modified: 2011-02-01 18:12 by SamChi