mirror of
https://github.com/Jonny007-MKD/OTR-DecodeAll
synced 2025-01-22 08:49:50 +01:00
Speedup grep
This commit is contained in:
parent
a668b0708c
commit
2bb97a5048
1 changed files with 2 additions and 2 deletions
|
@ -252,7 +252,7 @@ function funcUnlock {
|
||||||
|
|
||||||
function funcGetLabel {
|
function funcGetLabel {
|
||||||
if [ -n "$torrentDb" -a -r "$torrentDb" ]; then
|
if [ -n "$torrentDb" -a -r "$torrentDb" ]; then
|
||||||
label="$(grep -m 1 "$filename" $torrentDb | grep -o ' [a-zA-Z0-9_-]*$' | grep -o '[a-zA-Z0-9_-]*$')"
|
label="$(LC_ALL=C fgrep -m 1 "$filename" $torrentDb | grep -o ' [a-zA-Z0-9_-]*$' | grep -o '[a-zA-Z0-9_-]*$')"
|
||||||
funcLog 5 "label: $label"
|
funcLog 5 "label: $label"
|
||||||
else
|
else
|
||||||
funcLog 5 "no/incorrect torrentDb given"
|
funcLog 5 "no/incorrect torrentDb given"
|
||||||
|
@ -581,7 +581,7 @@ function funcRemove {
|
||||||
elif (( remove == 1 )); then # test torrent client
|
elif (( remove == 1 )); then # test torrent client
|
||||||
## Add more checks here, not only Deluge
|
## Add more checks here, not only Deluge
|
||||||
if [ -n "$delugeDir" ] && [ -d "$delugeDir/state" ]; then # If deluge config dir is defined
|
if [ -n "$delugeDir" ] && [ -d "$delugeDir/state" ]; then # If deluge config dir is defined
|
||||||
if [ -n "`grep "$filename" "$delugeDir/state" -R --include=*.torrent`" ]; then
|
if [ -n "`LC_ALL=C fgrep "$filename" "$delugeDir/state" -R --include=*.torrent`" ]; then
|
||||||
funcLog 4 "Torrent still exists in Deluge"
|
funcLog 4 "Torrent still exists in Deluge"
|
||||||
else
|
else
|
||||||
funcRemoveFile "$pathAbsEncoded";
|
funcRemoveFile "$pathAbsEncoded";
|
||||||
|
|
Loading…
Reference in a new issue