diff --git a/scripts/_common.sh b/scripts/_common.sh index ef8f08a..24d6046 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -34,5 +34,5 @@ extract_freshrss() { || ynh_die "Invalid checksum of downloaded tarball" tar xf "$rc_tarball" -C "$DESTDIR" --strip-components 1 \ || ynh_die "Unable to extract FreshRss tarball" - rm "$rc_tarball" + sudo rm "$rc_tarball" } diff --git a/scripts/backup b/scripts/backup index b80ebc0..00aa3fe 100755 --- a/scripts/backup +++ b/scripts/backup @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -eu # The parameter $1 is the backup directory location dedicated to the app BACKUP_DIR=$1 diff --git a/scripts/install b/scripts/install index 3c7e1c7..a635537 100755 --- a/scripts/install +++ b/scripts/install @@ -48,22 +48,6 @@ extract_freshrss "$TMPDIR" $TMPDIR/cli/do-install.php --default_user $admin_user --auth_type http_auth --environment production --base_url $domain/$path --title FreshRSS --api_enabled --db-type mysql --db-host localhost --db-user $db_user --db-password $db_pwd --db-base $db_name # Add users -#check wallabag -sharingEnable=0 -if sudo yunohost app list --installed -f wallabag2 | grep -q id ; then - echo "Detected wallabag V2" - wallabagPath=$(sudo yunohost app setting wallabag2 path | sed 's#/*$##') - wallabagUrl=$domain$wallabagPath - sharingWallabag="'sharing' => \n\tarray( \n\t\t0 => \n\t\tarray(\n\t\t\t'type' => 'wallabagv2',\n\t\t\t'name' => 'Wallabag',\n\t\t\t'url' => 'https://$wallabagUrl',\n\t\t)," - sharingEnable=1 -elif sudo yunohost app list --installed -f wallabag | grep -q id ; then - echo "Detected wallabag" - wallabagPath=$(sudo yunohost app setting wallabag path) - wallabagUrl=$domain$wallabagPath - sharingWallabag="'sharing' => \n\tarray( \n\t\t0 => \n\t\tarray(\n\t\t\t'type' => 'wallabag',\n\t\t\t'name' => 'Wallabag',\n\t\t\t'url' => 'https://$wallabagUrl',\n\t\t)," - sharingEnable=1 -fi - for myuser in $(ynh_user_list) do user_token=$(ynh_string_random) diff --git a/scripts/remove b/scripts/remove index 88a545a..f2e62c4 100755 --- a/scripts/remove +++ b/scripts/remove @@ -1,7 +1,7 @@ #!/bin/bash # Exit on command errors and treat unset variables as an error -set -eu +set -u # Source app helpers . /usr/share/yunohost/helpers diff --git a/scripts/restore b/scripts/restore index a477881..be7424e 100644 --- a/scripts/restore +++ b/scripts/restore @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -eu # The parameter $1 is the backup directory location dedicated to the app BACKUP_DIR=$1 diff --git a/scripts/upgrade b/scripts/upgrade index b44bfe0..be96054 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -8,6 +8,10 @@ set -eu # Source app helpers . /usr/share/yunohost/helpers +#install extention for api if necessary +ynh_package_install_from_equivs ../conf/${DEPS_PKG_NAME}.control \ + || ynh_die "Unable to install dependencies" + #old version cleanup if [ -f $FINAL_PATH/data/user.php.dist ]; then sudo rm $FINAL_PATH/data/user.php.dist @@ -36,8 +40,3 @@ sudo chown -R www-data: $TMPDIR/extensions/ # Clean up existing files and copy new files to the right place sudo rm -rf "$FINAL_PATH" sudo cp -rp "$TMPDIR" "$FINAL_PATH" - - -#install extention for api if necessary -ynh_package_install_from_equivs ../conf/${DEPS_PKG_NAME}.control \ - || ynh_die "Unable to install dependencies"