diff --git a/conf/systemd.service b/conf/systemd.service index 7f3282c..3766f3f 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -6,7 +6,7 @@ After=network.target Type=simple User=__APP__ Group=__APP__ -ExecStart=/opt/node_n/bin/ethercalc --port __PORT__ --expire __EXPIRE__ +ExecStart=/opt/node_n/n/versions/node/__NODE_VERSION__/bin/ethercalc --port __PORT__ --expire __EXPIRE__ EnvironmentFile=/etc/systemd/system/ethercalc.env RuntimeMaxSec=86400 Restart=always diff --git a/scripts/_common.sh b/scripts/_common.sh index 69c30cc..7c0c3d4 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,6 +6,8 @@ pkg_dependencies="redis-server" +node_version="4.8.7" + # ============================================================================= # YUNOHOST 2.7 FORTHCOMING HELPERS # ============================================================================= diff --git a/scripts/install b/scripts/install index 3a8e1a5..ec99121 100644 --- a/scripts/install +++ b/scripts/install @@ -58,7 +58,9 @@ ynh_app_setting_set $app port $port # INSTALL NODEJS #================================================= -ynh_install_nodejs 4.8.7 +ynh_install_nodejs $node_version + +ynh_app_setting_set $app node_version $node_version #================================================= # INSTALL DEPENDENCIES @@ -100,6 +102,7 @@ ynh_add_systemd_config ynh_replace_string --match_string="__PORT__" --replace_string=$port --target_file=/etc/systemd/system/ethercalc.service ynh_replace_string --match_string="__EXPIRE__" --replace_string=$expire --target_file=/etc/systemd/system/ethercalc.service +ynh_replace_string --match_string="__NODE_VERSION__" --replace_string=$node_version --target_file=/etc/systemd/system/ethercalc.service cp ../conf/ethercalc.env /etc/systemd/system/ethercalc.env diff --git a/scripts/remove b/scripts/remove index 2e18171..199ec28 100644 --- a/scripts/remove +++ b/scripts/remove @@ -28,6 +28,8 @@ final_path=$(ynh_app_setting_get $app final_path) ynh_remove_systemd_config +ynh_secure_remove /etc/systemd/system/ethercalc.env + #================================================= # REMOVE SERVICE FROM ADMIN PANEL #=================================================