UNIX&LINUX/쉘스크립트

쉘 스크립트 레드마인

nineDeveloper 2014. 5. 13. 18:29
728x90
반응형
스크립트
=============================================================================================
#!/bin/sh
CONF=/etc/config/qpkg.conf
QPKG_NAME="Redmine"

QPKG_DIR=$(/sbin/getcfg $QPKG_NAME Install_Path -d "" -f $CONF)

case "$1" in
  start)
    ENABLED=$(/sbin/getcfg $QPKG_NAME Enable -u -d FALSE -f $CONF)
    if [ "$ENABLED" != "TRUE" ]; then
        /bin/echo "$QPKG_NAME is disabled. - qpkg.conf : $ENABLED"
        exit 1
    fi

    /bin/echo "$QPKG_NAME is Enabled."

/opt/bin/ruby /share/MD0_DATA/.qpkg/Redmine/redmine-2.5.1/script/rails server webrick -d -e production
    ;;
    
  stop)
    /bin/echo "$QPKG_NAME is disabled."

    REDMINE=`pgrep -f redmine`
    kill -KILL $REDMINE
    ;;

  restart)
    $0 stop
    $0 start
    ;;

  *)
    /bin/echo "Usage: $0 {start|stop|restart}"
    exit 1
esac

exit 0
=============================================================================================

 

728x90
반응형