YUKI Piro Hiroshi
null+****@clear*****
Sun Sep 7 23:41:43 JST 2014
YUKI "Piro" Hiroshi 2014-09-07 23:41:43 +0900 (Sun, 07 Sep 2014) New Revision: 1d9e7502e9ce18db617f951a8bf6a124c436ed54 https://github.com/droonga/droonga-engine/commit/1d9e7502e9ce18db617f951a8bf6a124c436ed54 Message: Use service's name for service scripts and configuration files Modified files: script/install.sh Modified: script/install.sh (+9 -8) =================================================================== --- script/install.sh 2014-09-07 23:00:39 +0900 (458bcd6) +++ script/install.sh 2014-09-07 23:41:43 +0900 (8678e4a) @@ -13,8 +13,9 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +NAME=droonga-engine SCRIPT_URL=https://raw.githubusercontent.com/droonga/droonga-engine/master/script -USER=droonga-engine +USER=$NAME DROONGA_BASE_DIR=/home/$USER/droonga exist_user() { @@ -34,15 +35,15 @@ setup_configuration_directory() { mkdir $DROONGA_BASE_DIR [ ! -e $DROONGA_BASE_DIR/catalog.json ] && droonga-engine-catalog-generate --output=$DROONGA_BASE_DIR/catalog.json - [ ! -e $DROONGA_BASE_DIR/droonga-engine.yaml ] && - curl -o $DROONGA_BASE_DIR/droonga-engine.yaml $SCRIPT_URL/$PLATFORM/droonga-engine.yaml + [ ! -e $DROONGA_BASE_DIR/$NAME.yaml ] && + curl -o $DROONGA_BASE_DIR/droonga-engine.yaml $SCRIPT_URL/$PLATFORM/$NAME.yaml chown -R $USER.$USER $DROONGA_BASE_DIR } install_service_script() { INSTALL_LOCATION=$1 PLATFORM=$2 - DOWNLOAD_URL=$SCRIPT_URL/$PLATFORM/droonga-engine + DOWNLOAD_URL=$SCRIPT_URL/$PLATFORM/$NAME if [ ! -e $INSTALL_LOCATION ] then curl -o $INSTALL_LOCATION $DOWNLOAD_URL @@ -61,8 +62,8 @@ install_in_debian() { setup_configuration_directory debian # register droogna-engine as a service - install_service_script /etc/init.d/droonga-engine debian - update-rc.d droonga-engine defaults + install_service_script /etc/init.d/$NAME debian + update-rc.d $NAME defaults } install_in_centos() { @@ -76,8 +77,8 @@ install_in_centos() { setup_configuration_directory centos # register droogna-engine as a service - install_service_script /etc/rc.d/init.d/droonga-engine centos - /sbin/chkconfig --add droonga-engine + install_service_script /etc/rc.d/init.d/$NAME centos + /sbin/chkconfig --add $NAME } if [ -e /etc/debian_version ] || [ -e /etc/debian_release ]; then -------------- next part -------------- HTML����������������������������... Descargar