diff options
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 & |