diff options
author | nachoparker <nacho@ownyourbits.com> | 2018-06-19 15:00:20 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2018-06-19 18:19:15 +0300 |
commit | c727d65c3c900e610aa5ac93ce24aec84aa48c09 (patch) | |
tree | 100746a54f6e747f2987ca28f7ef2f26697c4b61 /etc | |
parent | 683cbc89c0c61fca778c3507a9e3d07f1f968f2c (diff) |
docker: fix persist ncp-web passwordv0.57.7
Diffstat (limited to 'etc')
-rw-r--r-- | etc/library.sh | 2 | ||||
-rw-r--r-- | etc/ncp-config.d/nc-passwd.sh | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/etc/library.sh b/etc/library.sh index dc3fe457..6d9b4a97 100644 --- a/etc/library.sh +++ b/etc/library.sh @@ -179,7 +179,7 @@ function persistent_cfg() local DST="${2:-/data/etc/$( basename "$SRC" )}" test -e /changelog.md && return # trick to disable in dev docker mkdir -p "$( dirname "$DST" )" - test -d "$DST" || { + test -e "$DST" || { echo "Making $SRC persistent ..." mv "$SRC" "$DST" } diff --git a/etc/ncp-config.d/nc-passwd.sh b/etc/ncp-config.d/nc-passwd.sh index 4d9243ee..89fdaba2 100644 --- a/etc/ncp-config.d/nc-passwd.sh +++ b/etc/ncp-config.d/nc-passwd.sh @@ -15,9 +15,18 @@ DESCRIPTION="Change password for the NextCloudPi Panel" configure() { + # update password echo -e "$PASSWORD_\n$CONFIRM_" | passwd ncp &>/dev/null && \ echo "password updated successfully" || \ { echo "passwords do not match"; return 1; } + + # persist ncp-web password in docker container + [[ -f /.docker-image ]] && { + mv /etc/shadow /data/etc/shadow + ln -s /data/etc/shadow /etc/shadow + } + + # activate NCP a2ensite ncp nextcloud a2dissite ncp-activation bash -c "sleep 1.5 && service apache2 reload" &>/dev/null & |