33# #########################################
44#
55# This script will copy all the required files into the correct locations on the server
6- # Config goes into: /usr/local/etc/scanoss/hfh
7- # Logs go into: /var/log/scanoss/hfh
6+ # Config goes into: /usr/local/etc/scanoss/folder-hashing-api
7+ # Logs go into: /var/log/scanoss/folder-hashing-api
88# Service definition goes into: /etc/systemd/system
99# Binary & startup go into: /usr/local/bin
1010#
1111# ###############################################################
1212
1313show_help () {
1414 echo " $0 [-h|--help] [-f|--force] [environment]"
15- echo " Setup and copy the required files into place on a server to run the SCANOSS HFH API"
15+ echo " Setup and copy the required files into place on a server to run the SCANOSS Folder Hashing API"
1616 echo " [environment] allows the optional specification of a suffix to allow multiple services"
1717 echo " -f | --force Run without interactive prompts (skip questions, skip SQLite setup, do not overwrite config)"
1818 exit 1
4040
4141ENVIRONMENT=" ${ENVIRONMENT:- $DEFAULT_ENV } "
4242export BASE_C_PATH=/usr/local/etc/scanoss
43- export CONFIG_DIR=" ${BASE_C_PATH} /hfh "
43+ export CONFIG_DIR=" ${BASE_C_PATH} /folder-hashing-api "
4444export LOG_DIR=/var/log/scanoss
45- export L_PATH=" ${LOG_DIR} /hfh "
45+ export L_PATH=" ${LOG_DIR} /folder-hashing-api "
4646export DB_PATH_BASE=/var/lib/scanoss
47- export SQLITE_PATH=" ${DB_PATH_BASE} /db/sqlite/hfh "
47+ export SQLITE_PATH=" ${DB_PATH_BASE} /db/sqlite/folder-hashing-api "
4848export SQLITE_DB_NAME=base.sqlite
4949export TARGET_SQLITE_DB_NAME=db.sqlite
5050export CONF_DOWNLOAD_URL=" https://raw.githubusercontent.com/scanoss/hfh/refs/heads/main/config/app-config-prod.json"
@@ -63,18 +63,18 @@ if [ "$EUID" -ne 0 ] ; then
6363fi
6464
6565if [ " $FORCE " = false ]; then
66- read -p " Install SCANOSS HFH API $ENVIRONMENT (y/n) [n]? " -n 1 -r
66+ read -p " Install SCANOSS Folder Hashing API $ENVIRONMENT (y/n) [n]? " -n 1 -r
6767 echo
6868 if [[ ! $REPLY =~ ^[Yy]$ ]] ; then
6969 echo " Stopping."
7070 exit 1
7171 fi
7272else
73- echo " [FORCE] Auto-accept installation of SCANOSS HFH API $ENVIRONMENT "
73+ echo " [FORCE] Auto-accept installation of SCANOSS Folder Hashing API $ENVIRONMENT "
7474fi
7575
7676# Setup all the required folders and ownership
77- echo " Setting up HFH API system folders..."
77+ echo " Setting up Folder Hashing API system folders..."
7878mkdir -p " $CONFIG_DIR " || { echo " Error: Problem creating $CONFIG_DIR " ; exit 1; }
7979mkdir -p " $L_PATH " || { echo " Error: Problem creating $L_PATH " ; exit 1; }
8080
@@ -84,11 +84,11 @@ if [ "$RUNTIME_USER" != "root" ] ; then
8484fi
8585
8686# Setup the service on the system
87- SC_SERVICE_FILE=" scanoss-hfh -api.service"
88- SC_SERVICE_NAME=" scanoss-hfh -api"
87+ SC_SERVICE_FILE=" scanoss-folder-hashing -api.service"
88+ SC_SERVICE_NAME=" scanoss-folder-hashing -api"
8989if [ -n " $ENVIRONMENT " ] ; then
90- SC_SERVICE_FILE=" scanoss-hfh -api-${ENVIRONMENT} .service"
91- SC_SERVICE_NAME=" scanoss-hfh -api-${ENVIRONMENT} "
90+ SC_SERVICE_FILE=" scanoss-folder-hashing -api-${ENVIRONMENT} .service"
91+ SC_SERVICE_NAME=" scanoss-folder-hashing -api-${ENVIRONMENT} "
9292fi
9393
9494service_stopped=" "
@@ -102,7 +102,7 @@ echo "Copying service startup config..."
102102if [ -f " $SC_SERVICE_FILE " ] ; then
103103 cp " $SC_SERVICE_FILE " /etc/systemd/system || { echo " Error: service copy failed" ; exit 1; }
104104fi
105- cp scanoss-hfh -api.sh /usr/local/bin || { echo " Error: startup script copy failed" ; exit 1; }
105+ cp scanoss-folder-hashing -api.sh /usr/local/bin || { echo " Error: startup script copy failed" ; exit 1; }
106106
107107# ###################################################
108108# SEARCH CONFIG FILE #
@@ -198,7 +198,7 @@ find "$DB_PATH_BASE" -type d -exec chmod 0750 "{}" \;
198198find " $DB_PATH_BASE " -type f -exec chmod 0640 " {}" \;
199199
200200# Copy the binaries if requested
201- BINARY=scanoss-hfh -api
201+ BINARY=scanoss-folder-hashing -api
202202if [ -f $BINARY ] ; then
203203 echo " Copying app binary to /usr/local/bin ..."
204204 cp $BINARY /usr/local/bin || { echo " Error copying $BINARY " ; exit 1; }
0 commit comments