diff --git a/conf/etherpad-lite b/conf/etherpad-lite index 1a77b77..d3d1f06 100644 --- a/conf/etherpad-lite +++ b/conf/etherpad-lite @@ -11,13 +11,13 @@ ### END INIT INFO PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/node/bin" -LOGFILE="/var/log/etherpad-lite/etherpad-lite.log" -EPLITE_DIR="/var/www/etherpadlite" +LOGFILE="/var/log/APPTOCHANGE/APPTOCHANGE.log" +EPLITE_DIR="/var/www/APPTOCHANGE" EPLITE_BIN="bin/safeRun.sh" USER="www-data" GROUP="www-data" DESC="Etherpad Lite" -NAME="etherpad-lite" +NAME="APPTOCHANGE" set -e @@ -25,7 +25,7 @@ set -e start() { echo "Starting $DESC... " - + start-stop-daemon --start --chuid "$USER:$GROUP" --background --make-pidfile --pidfile /var/run/$NAME.pid --exec $EPLITE_DIR/$EPLITE_BIN -- $LOGFILE || true echo "done" } @@ -53,7 +53,7 @@ stop() { } status() { - status_of_proc -p /var/run/$NAME.pid "" "etherpad-lite" && exit 0 || exit $? + status_of_proc -p /var/run/$NAME.pid "" "APPTOCHANGE" && exit 0 || exit $? } case "$1" in diff --git a/conf/settings.json b/conf/settings.json index 59ab799..44b4d84 100644 --- a/conf/settings.json +++ b/conf/settings.json @@ -88,6 +88,7 @@ /* Users for basic authentication. is_admin = true gives access to /admin. If you do not uncomment this, /admin will not be available! */ /* + TODO add argument to ask ynh user admin, and change that here "users": { "admin": { "password": "changeme1", diff --git a/scripts/install b/scripts/install index 77058c9..b5c2fe4 100644 --- a/scripts/install +++ b/scripts/install @@ -50,8 +50,8 @@ sudo mkdir -p $final_path sudo cp -a ../sources/* $final_path sudo cp ../conf/settings.json $final_path -#TODO one service per instance ? sudo cp ../conf/etherpad-lite /etc/init.d/$app +sudo sed -i "s/APPTOCHANGE/$app/g" /etc/init.d/$app sudo chmod +x /etc/init.d/$app sudo update-rc.d $app defaults diff --git a/scripts/remove b/scripts/remove index 61e4a9a..a060b6e 100644 --- a/scripts/remove +++ b/scripts/remove @@ -15,7 +15,7 @@ dbname=$(ynh_app_setting_get "$app" dbname) root_pwd=$(sudo cat /etc/yunohost/mysql) -mysql -u root -p$root_pwd -e "DROP DATABASE $dbname ; DROP USER $dbuser@localhost ;" +mysql -u root -p $root_pwd -e "DROP DATABASE $dbname ; DROP USER $dbuser@localhost ;" sudo rm -rf /var/www/$app rm -f /etc/nginx/conf.d/$domain.d/$app.conf