#!/usr/bin/sh #---------------------------------------------------------------------------------- # /var/install/bin/nextcloud-post-view-log - view log file # # Copyright (c) 2013-2025 The Eisfair Team, team(at)eisfair(dot)org # # Creation: 2013-02-11 jed # Last Update: $Id$ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------------- # read eislib etc. . /var/install/include/eislib pgmname=`basename $0` module_name="`echo "${pgmname}" | cut -d- -f1 | cut -d. -f1`" configfile=/etc/config.d/${module_name} logdir=/var/log NEXTCLOUD_LOG_TYPE=`grep -m 1 "^NEXTCLOUD_LOG_TYPE" ${configfile} | sed 's/^[A-Z0-9_]* *= *.\([a-z]*\).*$/\1/'` if [ -z "${NEXTCLOUD_LOG_TYPE}" ] then NEXTCLOUD_LOG_TYPE='file' fi case ${NEXTCLOUD_LOG_TYPE} in syslog ) rm -f ${logdir}/${module_name}.log ;; *|file ) if [ -L ${logdir}/${module_name}.log ] then # not a symbolic link, create backup rm -f ${logdir}/${module_name}.log fi ;; esac exit 0