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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
**scribe** is a **syslog-ng** and **logrotate** installer for ASUS routers running **Asuswrt-Merlin**

## v3.2.7
### Updated on 2026-Jan-11
### Updated on 2026-Jan-12

## Getting Started

Expand Down
54 changes: 40 additions & 14 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-11
# Last Modified: 2026-Jan-12
#-----------------------------------------------------------------

################ Shellcheck directives ################
Expand All @@ -35,7 +35,7 @@

readonly script_name="scribe"
readonly scribe_ver="v3.2.7"
readonly scriptVer_TAG="26011122"
readonly scriptVer_TAG="26011223"
scribe_branch="develop"
script_branch="$scribe_branch"

Expand Down Expand Up @@ -644,11 +644,35 @@ Reload_sngconf()
Copy_rcfunc()
{
printf "$white copying %s to %s ...$std" "$rcfunc_sng" "$init_d"
cp -pf "$unzip_dirPath/init.d/$rcfunc_sng" "$init_d/"
cp -fp "${unzip_dirPath}/init.d/$rcfunc_sng" "$init_d/"
chmod 644 "$rcfunc_loc"
finished
}

##-------------------------------------##
## Added by Martinski W. [2026-Jan-12] ##
##-------------------------------------##
Copy_LogRotate_Global_Config()
{
local forceUpdate=false
local srceFile="${unzip_dirPath}/${logRotateStr}.d/$logRotateGlobalName"

[ ! -s "$srceFile" ] && return 1
[ ! -d "$logRotateExamplesDir" ] && mkdir "$logRotateExamplesDir"
if [ $# -gt 0 ] && [ "$1" = "force" ]
then forceUpdate=true
fi

for destFile in "$logRotateGlobalConf" "${logRotateExamplesDir}/$logRotateGlobalName"
do
if [ ! -s "$destFile" ] || "$forceUpdate"
then
cp -fp "$srceFile" "$destFile" 2>/dev/null
chmod 600 "$destFile"
fi
done
}

##-------------------------------------##
## Added by Martinski W. [2026-Jan-11] ##
##-------------------------------------##
Expand Down Expand Up @@ -1146,22 +1170,23 @@ prt_vers()
printf "$std\n\n"
}

# Install default file in /usr/etc/$1.d #
# Install default file in /opt/etc/$1.d #
setup_ddir()
{
[ "$1" = "$sng" ] && d_dir="$sngd_d"
[ "$1" = "$lr" ] && d_dir="$lrd_d"

for dfile in "$unzip_dirPath/${1}.d"/*
for dfile in "${unzip_dirPath}/${1}.d"/*
do
dfbase="$( strip_path "$dfile" )"
ddfile="$d_dir/$dfbase"
{ [ ! -e "$ddfile" ] || [ "$2" = "ALL" ]; } && cp -p "$dfile" "$ddfile"
{ [ ! -e "$ddfile" ] || [ "$2" = "ALL" ]; } && \
cp -p "$dfile" "$ddfile"
done
chmod 600 "$d_dir"/*
}

# Install example files in /usr/share/$1/examples #
# Install example files in /opt/share/$1/examples #
setup_exmpls()
{
[ "$1" = "$sng" ] && share="$sng_share" && conf="$sng_conf"
Expand All @@ -1173,7 +1198,7 @@ setup_exmpls()
[ ! -d "$share" ] && mkdir "$share"
[ ! -d "$share/examples" ] && mkdir "$share/examples"

for exmpl in "$unzip_dirPath/${1}.share"/*
for exmpl in "${unzip_dirPath}/${1}.share"/*
do
shrfile="$share/examples/$( strip_path "$exmpl" )"
if [ ! -e "$shrfile" ] || [ "$2" = "ALL" ]
Expand Down Expand Up @@ -1938,10 +1963,10 @@ Menu_Filters()
fi
done
done
printf "\n$white %s and %s example files updated!$std\n" "$sng" "$lr"
printf "\n ${white}%s and %s example files updated!${std}\n" "$sng" "$lr"
Reload_sngconf
else
printf "\n$white %s and %s example files$red not$white updated!$std\n" "$sng" "$lr"
printf "\n ${white}%s and %s example files ${red}not${white} updated!${std}\n" "$sng" "$lr"
fi
}

Expand Down Expand Up @@ -1971,11 +1996,12 @@ Menu_Update()
fi
fi

if { [ $# -eq 1 ] && [ "$1" = "force" ] ; } || yes_no
if { [ $# -gt 0 ] && [ "$1" = "force" ] ; } || yes_no
then
Get_ZIP_File
Setup_Scribe "NEWER"
Copy_rcfunc
Copy_LogRotate_Global_Config "$@"
printf "\n$white %s updated!$std\n" "$script_name"
sh "$script_loc" filters gotzip nologo
sh "$script_loc" status nologo
Expand Down Expand Up @@ -2924,10 +2950,10 @@ case "$action" in
exit 0
;;

#Kill syslogd & klogd - only available via CLI#
#Kill syslogd & klogd#
service_event)
if ! SyslogNg_Running || [ "$2" = "stop" ] || \
[ "$2" = "reboot" ] || [ "$3" = "ntpd" ] || \
if ! SyslogNg_Running || [ -z "$2" ] || \
[ "$2" = "stop" ] || [ "$3" = "ntpd" ] || \
echo "$3" | grep -qE "^$uiscribeName"
then exit 0
fi
Expand Down