diff --git a/scripts/_common.sh b/scripts/_common.sh index 20fa5a2..e3c14e2 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -21,8 +21,8 @@ ynh_detect_arch(){ else ynh_die "Unable to detect your achitecture, please open a bug describing \ your hardware and the result of the command \"uname -m\"." 1 - fi - echo $architecture + fi + echo $architecture } diff --git a/scripts/install b/scripts/install index ae7ee3a..82cd81f 100644 --- a/scripts/install +++ b/scripts/install @@ -89,6 +89,24 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir=$final_path --source_id="$architecture" +#================================================= +# CREAT DIRECTORIES +#================================================= + +mkdir -p "/home/$app" + +DATADIR="/home/$app" + +REPO_PATH="/home/$app/repositories" +DATA_PATH="/home/$app/data" + +# create needed directories +mkdir -p "$final_path/data" +mkdir -p "$final_path/custom/conf/auth.d" +mkdir -p "/home/$app/data/avatars" +mkdir -p "/home/$app/data/attachments" +mkdir -p "/var/log/$app" + #================================================= # STANDARD MODIFICATIONS #================================================= @@ -96,20 +114,9 @@ ynh_setup_source --dest_dir=$final_path --source_id="$architecture" # Add users # We can't use the official helper because we need to set the shell for the login test getent passwd "$app" &>/dev/null || \ - useradd -d "$DATADIR" --system --user-group "$app" --shell /bin/bash || \ + useradd -d "/home/$app" --system --user-group "$app" --shell /bin/bash || \ ynh_die "Unable to create $app system account" -#================================================= -# CREAT DIRECTORIES -#================================================= - -# create needed directories -mkdir -p "$final_path/data" -mkdir -p "$final_path/custom/conf/auth.d" -mkdir -p "$DATA_PATH/avatars" -mkdir -p "$DATA_PATH/attachments" -mkdir -p "/var/log/$app" - #================================================= # MODIFY A CONFIG FILE #================================================= @@ -172,7 +179,6 @@ chmod u=rwX,g=rX,o= "$final_path" chmod u=rwX,g=rX,o= "/home/$app" chmod u=rwX,g=rX,o= "/var/log/$app" - # Unprotect root from SSO if public set_access_settings