root/main/trunk/greenstone3/service.d/INSTALL-SERVICE.sh @ 34321

Revision 34321, 0.7 KB (checked in by davidb, 8 weeks ago)

Initial cut at files necessary to install Greenstone3 as a service

  • Property svn:executable set to *
Line 
1#!/bin/bash
2
3if [ -d "/etc/systemd/system/" ] ; then
4
5    if [ "x$GSDL3SRCHOME" = "x" ] ; then
6    cd .. && source ./gs3-setup.sh && cd service.d
7    fi
8   
9    if [ ! -f greenstone3-service.sh ] ; then
10    echo "Generating greenstone3.service. from greenstone3.service.in"
11    cat greenstone3.service.in | sed "s%@GSDL3SRCHOME@%$GSDL3SRCHOME%g" > greenstone3.service
12    fi
13   
14    echo "Copying greenstone3.service to /etc/systemd/system/"
15    sudo /bin/cp greenstone3.service /etc/systemd/system/.
16else
17    echo "Error: Failed to find '/etc/systemd/system'" >&2
18    echo "This install script was developed on a Debian system." >&2
19    echo "It looks like your Linux Distribution uses a different directory structure for services" >&2
20
21    exit 1
22fi 
23
Note: See TracBrowser for help on using the browser.