nc-init.sh, ncp-update-nc, library.sh: Fix invalid architecture name in notify_push binary path

Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
This commit is contained in:
thecalcaholic 2022-08-26 11:58:02 +02:00
parent c41d38aa2a
commit c619589a22
No known key found for this signature in database
GPG Key ID: 3510056072886A8F
4 changed files with 8 additions and 11 deletions

View File

@ -194,8 +194,6 @@ else
apachectl -k graceful
## make sure the notify_push daemon is runnnig
arch="$(dpkg --print-architecture)"
[[ "${arch}" =~ ^(armhf|arm)$ ]] && arch="armv7"
cat > /etc/systemd/system/notify_push.service <<EOF
[Unit]
Description = Push daemon for Nextcloud clients
@ -206,7 +204,7 @@ Requires=redis.service
[Service]
Environment=PORT=7867
Environment=NEXTCLOUD_URL=https://localhost
ExecStart=/var/www/nextcloud/apps/notify_push/bin/"${arch}"/notify_push --allow-self-signed /var/www/nextcloud/config/config.php
ExecStart="/var/www/nextcloud/apps/notify_push/bin/${ARCH}/notify_push" --allow-self-signed /var/www/nextcloud/config/config.php
User=www-data
[Install]

View File

@ -152,7 +152,7 @@ EOF
ncc app:disable updatenotification
# News dropped support for 32-bit -> https://github.com/nextcloud/news/issues/1423
if ! [[ "$(dpkg --print-architecture)" =~ ^(armhf|arm)$ ]]; then
if ! [[ "$ARCH" =~ armv7 ]]; then
ncc app:install news
ncc app:enable news
fi

View File

@ -13,6 +13,10 @@ export BINDIR=/usr/local/bin/ncp
export NCDIR=/var/www/nextcloud
export ncc=/usr/local/bin/ncc
export NCPCFG=${NCPCFG:-etc/ncp.cfg}
export ARCH="$(dpkg --print-architecture)"
[[ "${ARCH}" =~ ^(armhf|arm)$ ]] && ARCH="armv7"
[[ "${ARCH}" == "arm64" ]] && ARCH=aarch64
[[ "${ARCH}" == "amd64" ]] && ARCH=x86_64
# Prevent systemd pager from blocking script execution
export SYSTEMD_PAGER=
@ -163,10 +167,7 @@ function start_notify_push
{
pgrep notify_push &>/dev/null && return
if [[ -f /.docker-image ]]; then
local arch
arch="$(dpkg --print-architecture)"
[[ "${arch}" =~ ^(armhf|arm)$ ]] && arch="armv7"
NEXTCLOUD_URL=https://localhost sudo -E -u www-data /var/www/nextcloud/apps/notify_push/bin/"${arch}"/notify_push --allow-self-signed /var/www/nextcloud/config/config.php &>/dev/null &
NEXTCLOUD_URL=https://localhost sudo -E -u www-data "/var/www/nextcloud/apps/notify_push/bin/${ARCH}/notify_push" --allow-self-signed /var/www/nextcloud/config/config.php &>/dev/null &
else
systemctl enable --now notify_push
fi

View File

@ -35,8 +35,6 @@ install_app nc-restore
[[ ! -f /.docker-image ]] && {
# fix HPB with dynamic public IP
arch="$(dpkg --print-architecture)"
[[ "${arch}" =~ ^(armhf|arm)$ ]] && arch="armv7"
cat > /etc/systemd/system/notify_push.service <<EOF
[Unit]
Description = Push daemon for Nextcloud clients
@ -45,7 +43,7 @@ After = mysql.service
[Service]
Environment = PORT=7867
Environment = NEXTCLOUD_URL=https://localhost
ExecStart = /var/www/nextcloud/apps/notify_push/bin/"${arch}"/notify_push --allow-self-signed /var/www/nextcloud/config/config.php
ExecStart = "/var/www/nextcloud/apps/notify_push/bin/${ARCH}/notify_push" --allow-self-signed /var/www/nextcloud/config/config.php
User=www-data
[Install]