Sha256: 617f2689c020e5974fcfef9d1b6331a0bc0cf0d65385ae3e380ac08ed77fc570

Contents?: true

Size: 1000 Bytes

Versions: 58

Compression:

Stored size: 1000 Bytes

Contents

#!/bin/bash

script=$0
path=`echo $script | sed 's/etc..*/bin/'`

PATH=$PATH:$path

ps=`facter ps`

if [ -z "$ps" ]; then
    ps="ps -ef"
fi

function start
{
    cd $path
    ./sleeper
}

function stop
{
    #if [ -n `which pgrep` ]; then
    #    pid=`pgrep sleeper`
    #else
        pid=`$ps | grep -v grep | grep sleeper | grep ruby | awk '{print $2}'`
    #fi
    if [ -n "$pid" ]; then
        kill $pid
    fi
}

function restart
{
    stop
    start
}

function status
{
    #if [ -n `which pgrep` ]; then
    #    cmd="pgrep sleeper"
    #else
        #cmd="$ps | grep -v grep | grep sleeper | grep ruby | awk '{print $2}'"
    #fi
    #$cmd
    $ps | grep -v grep | grep sleeper | grep ruby
}

case "$1" in
    start)
        start
    ;;
    stop)
        stop
    ;;
    restart)
        stop; start
    ;;
    status)
        output=`status`
        #status
        exit $?
    ;;
    *)
        echo "Usage: $N {start|stop|restart|force-reload}" >&2
        exit 1
    ;;
esac

exit 0

Version data entries

58 entries across 58 versions & 3 rubygems

Version Path
puppet-2.7.26 examples/etc/init.d/sleeper
puppet-2.7.25 examples/etc/init.d/sleeper
puppet-2.7.24 examples/etc/init.d/sleeper
puppet-2.7.23 examples/etc/init.d/sleeper
puppet-2.7.22 examples/etc/init.d/sleeper
puppet-2.7.21 examples/etc/init.d/sleeper
puppet-2.6.18 examples/etc/init.d/sleeper
puppet-3.0.2 examples/etc/init.d/sleeper
puppet-3.0.2.rc3 examples/etc/init.d/sleeper
puppet-3.0.2.rc2 examples/etc/init.d/sleeper
puppet-3.0.2.rc1 examples/etc/init.d/sleeper
puppet-2.7.20 examples/etc/init.d/sleeper
puppet-2.7.20.rc1 examples/etc/init.d/sleeper
puppet-3.0.1 examples/etc/init.d/sleeper
puppet-3.0.1.rc1 examples/etc/init.d/sleeper
puppet-3.0.0 examples/etc/init.d/sleeper
puppet-3.0.0.rc8 examples/etc/init.d/sleeper
puppet-3.0.0.rc7 examples/etc/init.d/sleeper
librarian-puppet-0.9.4 vendor/gems/ruby/1.8/gems/puppet-2.7.18/examples/etc/init.d/sleeper
puppet-3.0.0.rc5 examples/etc/init.d/sleeper