YUKI Piro Hiroshi
null+****@clear*****
Sun Sep 7 23:46:27 JST 2014
YUKI "Piro" Hiroshi 2014-09-07 23:46:27 +0900 (Sun, 07 Sep 2014) New Revision: 6e5952a6cf66a3f45d6adb1bc8decdc677cee3ba https://github.com/droonga/droonga-engine/commit/6e5952a6cf66a3f45d6adb1bc8decdc677cee3ba Message: Use service's name for service scripts and configuration files Modified files: script/install-master.sh Modified: script/install-master.sh (+10 -9) =================================================================== --- script/install-master.sh 2014-09-07 23:42:31 +0900 (5bfc520) +++ script/install-master.sh 2014-09-07 23:46:27 +0900 (c590ac3) @@ -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 -SCRIPT_URL=https://raw.githubusercontent.com/droonga/droonga-engine/master/script -USER=droonga-engine +NAME=droonga-engine +SCRIPT_URL=https://raw.githubusercontent.com/droonga/$NAME/master/script +USER=$NAME DROONGA_BASE_DIR=/home/$USER/droonga exist_user() { @@ -34,8 +35,8 @@ 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/$NAME.yaml $SCRIPT_URL/$PLATFORM/$NAME.yaml chown -R $USER.$USER $DROONGA_BASE_DIR } @@ -60,7 +61,7 @@ install_master() { 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 @@ -79,8 +80,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() { @@ -94,8 +95,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����������������������������...Download