update: improve check for apt (#1356)

fix check for running apt during update
(https://github.com/nextcloud/nextcloudpi/issues/1354)

Update script is exiting if any process contains 'apt' in the name. pgrep interpretes <pattern> as regular expression. Whole process name to be checked with option -x.
This commit is contained in:
Christoph Rössig 2021-10-05 21:26:26 +02:00 committed by GitHub
parent 31f20bcb25
commit 7c361c5cb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,8 +52,8 @@ samba
"
fi
# check running apt
pgrep apt &>/dev/null && { echo "apt is currently running. Try again later"; exit 1; }
# check running apt or apt-get
pgrep -x "apt|apt-get" &>/dev/null && { echo "apt is currently running. Try again later"; exit 1; }
cp etc/library.sh /usr/local/etc/