diff --git a/scripts/install b/scripts/install index e5935e0..73c2850 100644 --- a/scripts/install +++ b/scripts/install @@ -56,7 +56,7 @@ ynh_app_setting_set $app is_public $is_public #Install dependencies sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 >/dev/null -echo "deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list +echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list sudo apt-get update sudo apt-get install -y mongodb-org gzip curl graphicsmagick npm @@ -71,7 +71,7 @@ sudo n $NODE_VERSION sudo mkdir -p $final_path # Create user -sudo useradd -d "$final_path" -M $serviceuser +id -u $serviceuser || sudo useradd -d "$final_path" -M $serviceuser # Copy and set systemd configuration sed -i "s@#ROOTURL#@$domain@g" ../conf/rocketchat.service diff --git a/scripts/remove b/scripts/remove index d240c6d..e025c1f 100644 --- a/scripts/remove +++ b/scripts/remove @@ -13,7 +13,6 @@ source /usr/share/yunohost/helpers app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get $app domain) final_path=$(ynh_app_setting_get $app final_path) -serviceuser=$(ynh_app_setting_get $app serviceuser) sudo systemctl stop $app.service @@ -28,8 +27,5 @@ sudo rm -f /etc/systemd/system/$app.service # remove database!!! sudo mongo rocketchat --eval "db.dropDatabase()" -# remove user!!! -sudo userdel -r $serviceuser - sudo systemctl daemon-reload sudo systemctl reload nginx diff --git a/scripts/restore b/scripts/restore index 4291773..c261bd5 100644 --- a/scripts/restore +++ b/scripts/restore @@ -39,7 +39,7 @@ sudo yunohost app checkurl "${domain}${path}" -a "$app" || ynh_die sudo mkdir -p $final_path # Create user -sudo useradd -d "$final_path" -M $serviceuser +id -u $serviceuser || sudo useradd -d "$final_path" -M $serviceuser #================================================= # STANDARD RESTORATION STEPS