#!/bin/bash

# Display-only: tail the last N lines of Nextcloud's data/nextcloud.log.
# Default 100 lines if the user doesn't specify.

appNextcloudTailLogs() {
    local args="$1"
    local lines
    lines="$(authToolArg "$args" lines)"
    [[ -z "$lines" || ! "$lines" =~ ^[0-9]+$ ]] && lines=100

    runFileOp docker exec -u www-data nextcloud-service tail -n "$lines" /var/www/html/data/nextcloud.log 2>&1
}
