rendered paste bodycat << "EOF" > $dest/etc/rc.d/rc.screenlets
#!/bin/sh
# Start/stop/restart the screenlets deamon connection
pid=$(pidof -x screenlets-daemon 2> /dev/null)
screenlets_start()
{
if [ -x /usr/bin/screenlets-deamon ]; then
echo "Starting Screenlets-deamon: /usr/bin/screenlets-deamon"
( cd /usr/bin ; ./screenlets-daemon 2> /dev/null )
fi
}
screenlets_stop()
{
if [ ! -z ${pid} ] ; then
kill -9 $pid 2> /dev/null
else
echo "screenlets is not running"
fi
}
screenlets_restart()
{
screenlets_stop
sleep 3
screenlets_start
}
case "$1" in
'start')
screenlets_start
;;
'stop')
screenlets_stop
;;
'restart')
screenlets_restart
;;
*)
echo "usage $0 start|stop|restart"
esac
EOF