Last change
on this file since 36315 was 36315, checked in by davidb, 21 months ago |
Utility scripts for starting and stopping the Express-based web server that will ultimately provideBib-Stinky functionality; imprinted of files developed for the Hey You Interact with Me project
|
-
Property svn:executable
set to
*
|
File size:
1.2 KB
|
Line | |
---|
1 | #!/bin/bash
|
---|
2 |
|
---|
3 | full_progname="$PWD/${BASH_SOURCE#./}"
|
---|
4 | bibstinky_home=${full_progname%/*/*}
|
---|
5 |
|
---|
6 | if [ -d "/etc/systemd/system/" ] ; then
|
---|
7 |
|
---|
8 | bibstinky_service_username=${1-www-data}
|
---|
9 | echo ""
|
---|
10 |
|
---|
11 | echo "****"
|
---|
12 | echo "* Generating bibstinky.service from bibstinky.service.in"
|
---|
13 | echo "****"
|
---|
14 | cat bibstinky.service.in \
|
---|
15 | | sed "s%@BIBSTINKY_HOME@%$bibstinky_home%g" \
|
---|
16 | | sed "s%@BIBSTINKY_SERVICE_USERNAME@%$bibstinky_service_username%g" \
|
---|
17 | > bibstinky.service
|
---|
18 |
|
---|
19 | echo "****"
|
---|
20 | echo "* Copying bibstinky.service to /etc/systemd/system/"
|
---|
21 | echo "****"
|
---|
22 | sudo /bin/cp bibstinky.service /etc/systemd/system/.
|
---|
23 |
|
---|
24 | echo ""
|
---|
25 | echo "----"
|
---|
26 | echo "General info:"
|
---|
27 | echo " In the event of the service being updated, you will most likely need to run:"
|
---|
28 | echo " sudo systemctl daemon-reload"
|
---|
29 | echo ""
|
---|
30 | echo " To enable this service to be run at boot-up time, run:"
|
---|
31 | echo " sudo systemctl enable bibstinky"
|
---|
32 | echo "----"
|
---|
33 |
|
---|
34 | else
|
---|
35 | echo "Error: Failed to find '/etc/systemd/system'" >&2
|
---|
36 | echo "This install script was developed on a Debian system." >&2
|
---|
37 | echo "It looks like your Linux Distribution uses a different directory structure for services" >&2
|
---|
38 |
|
---|
39 | exit 1
|
---|
40 | fi
|
---|
41 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.