Skip to content

Commit

Permalink
nc-init.sh, ncp-update-nc, library.sh: Fix invalid architecture name …
Browse files Browse the repository at this point in the history
…in notify_push binary path

Signed-off-by: thecalcaholic <[email protected]>
  • Loading branch information
theCalcaholic committed Aug 26, 2022
1 parent c41d38a commit c619589
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
4 changes: 1 addition & 3 deletions bin/ncp-update-nc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion bin/ncp/CONFIG/nc-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions etc/library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=

Expand Down Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions updates/1.43.0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand Down

0 comments on commit c619589

Please sign in to comment.