diff --git a/scripts/install b/scripts/install index 387f7f5..4a060f3 100755 --- a/scripts/install +++ b/scripts/install @@ -75,9 +75,9 @@ ynh_system_user_create $app #================================================= # Créer le dossier de log -sudo mkdir -p /var/log/$app -sudo touch /var/log/$app/$app.log -sudo chown $app -R /var/log/$app +mkdir -p /var/log/$app +touch /var/log/$app/$app.log +chown $app -R /var/log/$app # Setup logrotate ynh_use_logrotate @@ -92,8 +92,8 @@ ynh_app_setting_set $app final_path $final_path ynh_setup_source $final_path # Set files ownership during installation -sudo chown $app: $final_path -R -sudo chmod 755 $final_path -R +chown $app: $final_path -R +chmod 755 $final_path -R #================================================= # Modify Nginx configuration file and copy it to Nginx conf directory @@ -114,38 +114,39 @@ ynh_add_systemd_config # INSTALL HASTEBIN #================================================= +ynh_use_nodejs script_dir="$PWD" pushd "$final_path" -sudo chown -R $app: $final_path -sudo npm install +chown -R $app: $final_path +npm install #================================================= # Configure haste with config.js file #================================================= - sudo cp ../conf/config.js "$DESTDIR"/config.js - sudo sed -i "s@YNH_DATA_PATH@$DATA_PATH@g" "$DESTDIR"/config.js + cp ../conf/config.js "$DESTDIR"/config.js + sed -i "s@YNH_DATA_PATH@$DATA_PATH@g" "$DESTDIR"/config.js #================================================= # Add HASTE AS A BINARY FILE #================================================= ynh_replace_string "YNH_HASTE_URL" "${DOMAIN}${path%/}" "../conf/haste.sh" -sudo cp ../conf/haste.sh /usr/bin/"$app" -sudo chmod +x /usr/bin/"$app" +cp ../conf/haste.sh /usr/bin/"$app" +chmod +x /usr/bin/"$app" ================================================= # ENABLE SERVICE IN ADMIN PANEL #================================================= # Ajoute le service au monitoring de Yunohost. -sudo yunohost service add $app --log "/var/log/$app/$app.log" +yunohost service add $app --log "/var/log/$app/$app.log" #================================================= # START HASTEBIN IN BACKGROUND #================================================= -sudo systemctl start $app +systemctl start $app #================================================= # SETUP SSOWAT @@ -160,4 +161,4 @@ fi # RELOAD NGINX #================================================= -sudo systemctl reload nginx +systemctl reload nginx