mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-10 15:12:01 -03:30
ncp-update: Prevent running update script inside docker without explicit confirmation
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com> Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
This commit is contained in:
parent
780d02a6bd
commit
0c3a817421
@ -4,6 +4,15 @@
|
||||
|
||||
[[ -z "$DBG" ]] || set -$DBG
|
||||
|
||||
if [[ -f /.dockerenv ]] || [[ -f /.docker-image ]] || [[ "$DOCKERBUILD" == 1 ]]
|
||||
then
|
||||
echo "WARNING: Docker images should be updated by replacing the container from the latest docker image" \
|
||||
"(refer to the documentation for instructions: https://docs.nextcloudpi.com)." \
|
||||
"If you are sure that you know what you are doing, you can still execute the update script by running it like this:"
|
||||
echo "> ALLOW_UPDATE_SCRIPT=1 ncp-update"
|
||||
[[ "$ALLOW_UPDATE_SCRIPT" == "1" ]] || exit 1
|
||||
fi
|
||||
|
||||
{
|
||||
[ "$(id -u)" -ne 0 ] && { printf "Must be run as root. Try 'sudo $0'\n"; exit 1; }
|
||||
|
||||
|
||||
2
ncp.sh
2
ncp.sh
@ -29,6 +29,8 @@ install()
|
||||
test -f /usr/bin/raspi-config && {
|
||||
sed -i '/Change User Password/i"0 NextCloudPi Configuration" "Configuration of NextCloudPi" \\' /usr/bin/raspi-config
|
||||
sed -i '/1\\ \*) do_change_pass ;;/i0\\ *) ncp-config ;;' /usr/bin/raspi-config
|
||||
# Disable raspberry pi default user
|
||||
usermod pi -s /sbin/nologin
|
||||
}
|
||||
|
||||
# add the ncc shortcut
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user