check for installed Nextcloud to allow container restart before installation (#173)

This commit is contained in:
macmeck 2017-04-20 03:48:28 +02:00 committed by Wonderfall
parent 8f541d2828
commit 3b97570118

View File

@ -32,14 +32,16 @@ if [ ! -f /config/config.php ]; then
# New installation, run the setup # New installation, run the setup
/usr/local/bin/setup.sh /usr/local/bin/setup.sh
else else
if [ $(occ | head -n 1 | grep -ic "Nextcloud version.*") == "1" ] ; then
occ upgrade occ upgrade
if [ \( $? -ne 0 \) -a \( $? -ne 3 \) ]; then if [ \( $? -ne 0 \) -a \( $? -ne 3 \) ]; then
echo "Trying ownCloud upgrade again to work around ownCloud upgrade bug..." echo "Trying Nextcloud upgrade again to work around Nextcloud upgrade bug..."
occ upgrade occ upgrade
if [ \( $? -ne 0 \) -a \( $? -ne 3 \) ]; then exit 1; fi if [ \( $? -ne 0 \) -a \( $? -ne 3 \) ]; then exit 1; fi
occ maintenance:mode --off occ maintenance:mode --off
echo "...which seemed to work." echo "...which seemed to work."
fi fi
fi
fi fi
exec su-exec $UID:$GID /bin/s6-svscan /etc/s6.d exec su-exec $UID:$GID /bin/s6-svscan /etc/s6.d