Ver Fonte

move install systemd service to another script

blezz-tech há 2 dias atrás
pai
commit
e3f4ef7c2d
2 ficheiros alterados com 27 adições e 25 exclusões
  1. 0 25
      bin/install.sh
  2. 27 0
      bin/install_services.sh

+ 0 - 25
bin/install.sh

@@ -74,28 +74,3 @@ python manage.py create_metaservice_default_data
 if (($GENERATE_TEST_USERS)); then
     python manage.py create_metaservice_test_users
 fi
-
-echo_warning "Recreating sharix_open.service"
-\cp conf/sharix_open.service.example conf/sharix_open.service
-sed -i "s|WORKING_DIRECTORY|$(pwd)|g" conf/sharix_open.service
-echo_success "Recreated sharix_open.service"
-
-echo_warning "Copying sharix_open.service to /etc/systemd/system/ folder"
-\cp conf/sharix_open.service /etc/systemd/system/
-echo_success "Copied sharix_open.service to /etc/systemd/system/ folder"
-
-echo_warning "Reloading systemd daemon"
-systemctl daemon-reload
-echo_success "Reloaded systemd daemon"
-
-# Checking for webservice_running/handlers/.env
-if [ -f webservice_running/handlers/.env ]; then
-    echo "env file for handlers already exists. "
-else
-    echo_warning "Creating env file for handlers."
-    cp webservice_running/handlers/.env.example webservice_running/handlers/.env
-    echo_success "Created env file for handlers."
-fi
-
-echo_warning "Installation handlers"
-webservice_running/handlers/conf/bin/install.sh

+ 27 - 0
bin/install_services.sh

@@ -0,0 +1,27 @@
+source ./bin/utils/functions.sh
+source .env
+
+echo_warning "Recreating sharix_open.service"
+\cp conf/sharix_open.service.example conf/sharix_open.service
+sed -i "s|WORKING_DIRECTORY|$(pwd)|g" conf/sharix_open.service
+echo_success "Recreated sharix_open.service"
+
+echo_warning "Copying sharix_open.service to /etc/systemd/system/ folder"
+\cp conf/sharix_open.service /etc/systemd/system/
+echo_success "Copied sharix_open.service to /etc/systemd/system/ folder"
+
+echo_warning "Reloading systemd daemon"
+systemctl daemon-reload
+echo_success "Reloaded systemd daemon"
+
+# Checking for webservice_running/handlers/.env
+if [ -f webservice_running/handlers/.env ]; then
+    echo "env file for handlers already exists. "
+else
+    echo_warning "Creating env file for handlers."
+    cp webservice_running/handlers/.env.example webservice_running/handlers/.env
+    echo_success "Created env file for handlers."
+fi
+
+echo_warning "Installation handlers"
+webservice_running/handlers/conf/bin/install.sh