Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/Create-NewReleases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
steps:
# 1--- Check out master so we tag the exact merge commit
- name: Checkout source code
uses: actions/checkout@v6.0.1
uses: actions/checkout@v6.0.2
with:
fetch-depth: 0
ref: 'master'
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

**scribe** is a **syslog-ng** and **logrotate** installer for ASUS routers running **Asuswrt-Merlin**

## v3.2.7
### Updated on 2026-Jan-24
## v3.2.8
### Updated on 2026-Jan-25

## Getting Started

Expand Down
47 changes: 24 additions & 23 deletions init.d/rc.func.syslog-ng
Original file line number Diff line number Diff line change
@@ -1,51 +1,52 @@
#!/bin/sh -
#
# NB: rc.func only runs PRECMD on "start"
# Last Modified: 2026-Jan-15
# VERSION="3.1.3"
# Last Modified: 2026-Jan-25
# VERSION="3.1.4"
#-------------------------------------------

## Run the F/W built-in native commands ##
grepCmd="$(which -a grep | grep -v '^/opt/')"
psCmd="$(which -a ps | $grepCmd -v '^/opt/')"
rmCmd="$(which -a rm | $grepCmd -v '^/opt/')"
lnCmd="$(which -a ln | $grepCmd -v '^/opt/')"
lsCmd="$(which -a ls | $grepCmd -v '^/opt/')"
awkCmd="$(which -a awk | $grepCmd -v '^/opt/')"
catCmd="$(which -a cat | $grepCmd -v '^/opt/')"
cutCmd="$(which -a cut | $grepCmd -v '^/opt/')"
pidofCmd="$(which -a pidof | $grepCmd -v '^/opt/')"
loggerCmd="$(which -a logger | $grepCmd -v '^/opt/')"
grepCmd="/bin/grep"
headCmd="/usr/bin/head"
psCmd="$(which -a ps | $grepCmd -v '^/opt/' | $headCmd -n1)"
rmCmd="$(which -a rm | $grepCmd -v '^/opt/' | $headCmd -n1)"
lnCmd="$(which -a ln | $grepCmd -v '^/opt/' | $headCmd -n1)"
lsCmd="$(which -a ls | $grepCmd -v '^/opt/' | $headCmd -n1)"
awkCmd="$(which -a awk | $grepCmd -v '^/opt/' | $headCmd -n1)"
catCmd="$(which -a cat | $grepCmd -v '^/opt/' | $headCmd -n1)"
cutCmd="$(which -a cut | $grepCmd -v '^/opt/' | $headCmd -n1)"
pidofCmd="$(which -a pidof | $grepCmd -v '^/opt/' | $headCmd -n1)"
loggerCmd="$(which -a logger | $grepCmd -v '^/opt/' | $headCmd -n1)"
logTagStr="scribe:kill_logger[$$]"
logPrioNum="-p 4"

##----------------------------------------##
## Modified by Martinski W. [2026-Jan-11] ##
## Modified by Martinski W. [2026-Jan-25] ##
##----------------------------------------##
kill_logger()
{
local serviceCallOK prevSysLog_Loc messagesLogSAVED
local scribeScriptFPath="/jffs/scripts/scribe"
local syslogNg_WaitnSEM_FPath="/tmp/var/tmp/scribe_SysLogNg.WAITN.SEM"
local syslogNg_StartSEM_FPath="/tmp/var/tmp/scribe_SysLogNg.START.SEM"
local syslogNG_WaitnSEM_FPath="/tmp/var/tmp/scribe_SysLogNg.WAITN.SEM"
local syslogNG_StartSEM_FPath="/tmp/var/tmp/scribe_SysLogNg.START.SEM"

if [ $# -eq 0 ] || [ -z "$1" ] || [ "$1" = "true" ]
then
serviceCallOK=true
else
serviceCallOK=false
[ ! -f "$syslogNg_StartSEM_FPath" ] && exit 1
[ ! -f "$syslogNG_StartSEM_FPath" ] && exit 1
fi

# If START Semaphore NOT found, call Scribe to set it up after a specified delay #
if [ ! -f "$syslogNg_StartSEM_FPath" ]
if [ ! -f "$syslogNG_StartSEM_FPath" ]
then
$loggerCmd -t "$logTagStr" $logPrioNum "Calling Scribe SysLogNgStartDelay..."
echo "150" > "$syslogNg_WaitnSEM_FPath"
echo "150" > "$syslogNG_WaitnSEM_FPath"
nohup "$scribeScriptFPath" SysLogNgStartDelay >/dev/null 2>&1 &
exit 1
fi
$rmCmd -f "$syslogNg_WaitnSEM_FPath" #Done waiting. We can start now#
$rmCmd -f "$syslogNG_WaitnSEM_FPath" #Done waiting. We can start now#

# These will be set if coming from Scribe; on bootup, these will NOT be set #
[ -z "$tmplog" ] && tmplog="/tmp/syslog.log"
Expand Down Expand Up @@ -138,9 +139,9 @@ kill_logger()
then ## Transfer 1st part of the system log ##
$catCmd "${syslog_loc}-1" >> "$optmsg"
fi
$catCmd "$syslog_loc" >> "$optmsg"
[ -s "$syslog_loc" ] && $catCmd "$syslog_loc" >> "$optmsg"
$rmCmd -f "$syslog_loc" "${syslog_loc}-1"
$lnCmd -s "$optmsg" "$syslog_loc"
$lnCmd -snf "$optmsg" "$syslog_loc"
echo "$log1Msg" > "${syslog_loc}-1"
fi

Expand All @@ -154,8 +155,8 @@ kill_logger()
then
# If syslogd is writing to /jffs, then ensure logfiles in /tmp #
# are properly linked, in case something goes looking there #
[ ! -L "$tmplog" ] && $lnCmd -s "$optmsg" "$tmplog"
[ ! -L "${tmplog}-1" ] && $lnCmd -s "${syslog_loc}-1" "${tmplog}-1"
[ ! -L "$tmplog" ] && $lnCmd -snf "$optmsg" "$tmplog"
[ ! -L "${tmplog}-1" ] && $lnCmd -snf "${syslog_loc}-1" "${tmplog}-1"
fi

# Create /opt/var/run/syslog-ng/ directory if it doesn't exist #
Expand Down
16 changes: 10 additions & 6 deletions scribe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# curl --retry 3 "https://raw.githubusercontent.com/AMTM-OSR/scribe/master/scribe.h" -o "/jffs/scripts/scribe" && chmod 0755 /jffs/scripts/scribe && /jffs/scripts/scribe install
#
##################################################################
# Last Modified: 2026-Jan-15
# Last Modified: 2026-Jan-25
#-----------------------------------------------------------------

################ Shellcheck directives ################
Expand All @@ -34,9 +34,9 @@
#################################################################

readonly script_name="scribe"
readonly scribe_ver="v3.2.7"
readonly scriptVer_TAG="26011523"
scribe_branch="master"
readonly scribe_ver="v3.2.8"
readonly scriptVer_TAG="26012523"
scribe_branch="develop"
script_branch="$scribe_branch"

# Ensure firmware binaries are used, not Entware #
Expand Down Expand Up @@ -1723,7 +1723,7 @@ PreInstall_Check()
}

##----------------------------------------##
## Modified by Martinski W. [2025-Dec-05] ##
## Modified by Martinski W. [2026-Jan-25] ##
##----------------------------------------##
Menu_Install()
{
Expand All @@ -1736,6 +1736,8 @@ Menu_Install()
Do_Install "$sng" "FORCE"
fi
echo
rm -f "$syslogNg_WaitnSEM_FPath"
echo "1" > "$syslogNg_StartSEM_FPath"
$S01sng_init start

if [ ! -e "$lr_loc" ]
Expand Down Expand Up @@ -2008,7 +2010,7 @@ Menu_Filters()
}

##----------------------------------------##
## Modified by Martinski W. [2025-Jul-07] ##
## Modified by Martinski W. [2026-Jan-25] ##
##----------------------------------------##
Menu_Update()
{
Expand Down Expand Up @@ -2041,6 +2043,8 @@ Menu_Update()
Copy_SysLogNg_Top_Config "$@"
Copy_LogRotate_Global_Options "$@"
printf "\n$white %s updated!$std\n" "$script_name"
rm -f "$syslogNg_WaitnSEM_FPath"
echo "1" > "$syslogNg_StartSEM_FPath"
sh "$script_loc" filters gotzip nologo
sh "$script_loc" status nologo
run_scribe=true
Expand Down