summaryrefslogtreecommitdiffstats
path: root/Services/nodejs/run.sh
diff options
context:
space:
mode:
Diffstat (limited to 'Services/nodejs/run.sh')
-rw-r--r--Services/nodejs/run.sh34
1 files changed, 8 insertions, 26 deletions
diff --git a/Services/nodejs/run.sh b/Services/nodejs/run.sh
index 870958a..dcf7bac 100644
--- a/Services/nodejs/run.sh
+++ b/Services/nodejs/run.sh
@@ -1,13 +1,16 @@
#!/bin/bash
source /bin/sx-lib.sh
-
function check_nodejs_environment {
check_environment
if [ ! -v APP_PATH ]; then
- APP_PATH="/data"
+ APP_PATH="/app"
export APP_PATH
fi
+ if [ ! -v DATA_PATH ]; then
+ DATA_PATH="/data"
+ export DATA_PATH
+ fi
if [ ! -v LOG_PATH ]; then
LOG_PATH="/logs"
export LOG_PATH
@@ -31,34 +34,15 @@ function display_container_nodejs_header {
if [ -v APP_PATH ]; then
echo "| App path : $APP_PATH"
fi
+ if [ -v DATA_PATH ]; then
+ echo "| Data path : $DATA_PATH"
+ fi
if [ -v LOG_PATH ]; then
echo "| Log path : $LOG_PATH"
fi
echo "+====================================================="
}
-# Begin configuration before starting daemonized process
-# and start generating host keys
-function begin_config {
- echo "=> BEGIN NODEJS CONFIGURATION"
- if [[ -d $TMP_APP_PATH ]]; then
- if [ "$(ls -A $TMP_APP_PATH)" ]; then
- echo "COPY application from $TMP_APP_PATH into $APP_PATH"
- FILE_LIST=$(find $TMP_APP_PATH -maxdepth 1 -mindepth 1 -printf "%f\n")
- for FILE in $FILE_LIST; do
- echo -n "adding $APP_PATH/$FILE"
- cp -r $TMP_APP_PATH/$FILE $APP_PATH/
- echo " DONE"
- done
- fi
- fi
-}
-
-# End configuration process just before starting daemon
-function end_config {
- echo "=> END NODEJS CONFIGURATION"
-}
-
function stop_nodejs_handler {
killall node
echo "+=====================================================" | tee -a $STARTUPLOG
@@ -79,6 +63,4 @@ function start_service_nodejs {
check_nodejs_environment | tee -a $STARTUPLOG
display_container_nodejs_header | tee -a $STARTUPLOG
-begin_config | tee -a $STARTUPLOG
-end_config | tee -a $STARTUPLOG
start_service_nodejs