HEX
Server: Apache/2.4.41 (Amazon) OpenSSL/1.0.2k-fips PHP/5.6.40
System: Linux ip-172-31-40-18 4.14.146-93.123.amzn1.x86_64 #1 SMP Tue Sep 24 00:45:23 UTC 2019 x86_64
User: apache (48)
PHP: 5.6.40
Disabled: NONE
Upload Files
File: //etc/init.d/cfn-hup
#!/bin/bash
#
# cfn-hup       CloudFormation update trigger daemon
#
# chkconfig:    - 80 20
#
# description:  Runs user-specified actions when a
#               specified CloudFormation stack is
#               updated
# processname:  cfn-hup
# config: /etc/cfn/cfn-hup.conf
# pidfile: /var/run/cfn-hup.pid
#
# source function library
. /etc/rc.d/init.d/functions

RETVAL=0

start() {
        echo -n $"Starting cfn-hup: "
        daemon /opt/aws/bin/cfn-hup
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/cfn-hup
}

stop() {
        echo -n $"Stopping cfn-hup: "
        killproc -p /var/run/cfn-hup.pid cfn-hup
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/cfn-hup
}
  
restart() {
        stop
        start
}

case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart|force-reload|reload)
        restart
        ;;
  condrestart|try-restart)
        [ -f /var/lock/subsys/cfn-hup ] && restart
        ;;
  status)
        status -p /var/run/cfn-hup.pid cfn-hup
        RETVAL=$?
        ;;
  *)
        echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
        exit 1
esac
  
exit $RETVAL