[NAS Typ:] TS-109 Pro II
[Firmware:] 2.1.4 0318
[Getestet:] ja
[Sonstige Modifikationen:] keine Angabe (sehr witzig... *g*)
Da oft angefragt hier einmal ein kleines Script, dass Die rekursive Volltextsuche erleichtert.
Ich nenne dieses Script jetzt einfach mal "
"
Bash
#!/bin/sh
# grepall - simple full-text search script
# 07.05.2008 @ qnapclub.de
#
# You can simply use this script by adding:
# export PATH=$PATH:scriptdirectory
# in the autorun.sh
if [ $# -ne 3 ]; then
echo 1>&2 Usage: $0 [PATH...] [FILENAME] [PATTERN]
echo Example: /etc/ '"*.conf"' '"Port 80"'
exit 127
fi
/opt/bin/find $1 -type f -name "$2" -exec grep -q "$3" {} \; -print
exit 0
Alles anzeigen
[chmod +x nicht vergessen ;)]
Tipp: Bei Bedarf einfach mal ein Verzeichnis für shell-scripts erstellen, und die PATH Variable in der autorun.sh hinzufügen.
PS: Narülich funktioniert so etwas auch ohne das Script, ist so aber angenehmer.