From 7df9f017d764057229734891e7075d30e858aa47 Mon Sep 17 00:00:00 2001 From: julienmalik Date: Sat, 21 Feb 2015 17:39:21 +0100 Subject: [PATCH 1/2] [fix] ensure ffsync user is created before it is used --- scripts/install | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 6836a08..8e9ea0a 100644 --- a/scripts/install +++ b/scripts/install @@ -33,6 +33,9 @@ then sudo swapon $tmp_swap_file fi +# Create ffsync user +sudo useradd ffsync -d $final_path + # Copy files to the right place final_path=/opt/yunohost/ffsync sudo mkdir -p $final_path @@ -43,7 +46,6 @@ sudo touch /var/log/ffsync.log sudo chown ffsync /var/log/ffsync.log # Set permissions to ffsync directory -sudo useradd ffsync -d $final_path sudo chown ffsync:ffsync -R $final_path # Modify Nginx configuration file and copy it to Nginx conf directory From 1fa30a87ffff4c0dbf8f7763366c02a738093ba3 Mon Sep 17 00:00:00 2001 From: Julien Malik Date: Sun, 22 Feb 2015 10:23:06 +0100 Subject: [PATCH 2/2] [fix] do not use $final_path before it is defined --- scripts/install | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 8e9ea0a..255628e 100644 --- a/scripts/install +++ b/scripts/install @@ -33,9 +33,6 @@ then sudo swapon $tmp_swap_file fi -# Create ffsync user -sudo useradd ffsync -d $final_path - # Copy files to the right place final_path=/opt/yunohost/ffsync sudo mkdir -p $final_path @@ -43,10 +40,11 @@ sudo cp -a ../sources/* $final_path sudo cp ../conf/ffsync /etc/init.d/ sudo cp ../conf/ffsync.logrotate /etc/logrotate.d/ffsync sudo touch /var/log/ffsync.log -sudo chown ffsync /var/log/ffsync.log # Set permissions to ffsync directory +sudo useradd ffsync -d $final_path sudo chown ffsync:ffsync -R $final_path +sudo chown ffsync /var/log/ffsync.log # Modify Nginx configuration file and copy it to Nginx conf directory secret=$(head -c 20 /dev/urandom | sha1sum | cut -d " " -f1)