Skip to content

Commit 0162be0

Browse files
committed
nc-init.sh, ncp-update-nc, library.sh: Fix invalid architecture name in notify_push binary path
Signed-off-by: thecalcaholic <[email protected]>
1 parent c41d38a commit 0162be0

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

bin/ncp-update-nc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,6 @@ else
194194
apachectl -k graceful
195195
## make sure the notify_push daemon is runnnig
196196

197-
arch="$(dpkg --print-architecture)"
198-
[[ "${arch}" =~ ^(armhf|arm)$ ]] && arch="armv7"
199197
cat > /etc/systemd/system/notify_push.service <<EOF
200198
[Unit]
201199
Description = Push daemon for Nextcloud clients
@@ -206,7 +204,7 @@ Requires=redis.service
206204
[Service]
207205
Environment=PORT=7867
208206
Environment=NEXTCLOUD_URL=https://localhost
209-
ExecStart=/var/www/nextcloud/apps/notify_push/bin/"${arch}"/notify_push --allow-self-signed /var/www/nextcloud/config/config.php
207+
ExecStart="/var/www/nextcloud/apps/notify_push/bin/${ARCH}/notify_push" --allow-self-signed /var/www/nextcloud/config/config.php
210208
User=www-data
211209
212210
[Install]

bin/ncp/CONFIG/nc-init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ EOF
152152
ncc app:disable updatenotification
153153

154154
# News dropped support for 32-bit -> https://github.com/nextcloud/news/issues/1423
155-
if ! [[ "$(dpkg --print-architecture)" =~ ^(armhf|arm)$ ]]; then
155+
if ! [[ "$ARCH" =~ armv7 ]]; then
156156
ncc app:install news
157157
ncc app:enable news
158158
fi

etc/library.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ export BINDIR=/usr/local/bin/ncp
1313
export NCDIR=/var/www/nextcloud
1414
export ncc=/usr/local/bin/ncc
1515
export NCPCFG=${NCPCFG:-etc/ncp.cfg}
16+
export ARCH="$(dpkg --print-architecture)"
17+
[[ "${ARCH}" =~ ^(armhf|arm)$ ]] && ARCH="armv7"
18+
[[ "${ARCH}" == "arm64" ]] && ARCH=aarch64
19+
[[ "${ARCH}" == "amd64" ]] && ARCH=x86_64
1620
# Prevent systemd pager from blocking script execution
1721
export SYSTEMD_PAGER=
1822

@@ -163,10 +167,7 @@ function start_notify_push
163167
{
164168
pgrep notify_push &>/dev/null && return
165169
if [[ -f /.docker-image ]]; then
166-
local arch
167-
arch="$(dpkg --print-architecture)"
168-
[[ "${arch}" =~ ^(armhf|arm)$ ]] && arch="armv7"
169-
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 &
170+
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 &
170171
else
171172
systemctl enable --now notify_push
172173
fi

updates/1.43.0.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ install_app nc-restore
3535
[[ ! -f /.docker-image ]] && {
3636

3737
# fix HPB with dynamic public IP
38-
arch="$(dpkg --print-architecture)"
39-
[[ "${arch}" =~ ^(armhf|arm)$ ]] && arch="armv7"
4038
cat > /etc/systemd/system/notify_push.service <<EOF
4139
[Unit]
4240
Description = Push daemon for Nextcloud clients
@@ -45,7 +43,7 @@ After = mysql.service
4543
[Service]
4644
Environment = PORT=7867
4745
Environment = NEXTCLOUD_URL=https://localhost
48-
ExecStart = /var/www/nextcloud/apps/notify_push/bin/"${arch}"/notify_push --allow-self-signed /var/www/nextcloud/config/config.php
46+
ExecStart = "/var/www/nextcloud/apps/notify_push/bin/${ARCH}/notify_push" --allow-self-signed /var/www/nextcloud/config/config.php
4947
User=www-data
5048
5149
[Install]

0 commit comments

Comments
 (0)