0
0
mirror of https://github.com/anthonyaxenov/iptv.git synced 2024-11-01 01:26:00 +00:00
iptv/tools/find-in-all.sh

26 lines
834 B
Bash
Raw Normal View History

#!/bin/bash
#################################################
#
# IPTV channel finder (all playlists)
#
# Usage:
# ./download-all.sh
# ./find-in-all.sh "(disney|atv)"
#
# 1st argument is channel name pattern.
#
# Anthony Axenov (c) 2022
# The MIT License:
# https://github.com/anthonyaxenov/iptv/blob/master/LICENSE
#
#################################################
2022-10-22 09:02:36 +00:00
TOOLS_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )";
2022-10-22 14:44:05 +00:00
DL_DIR="$TOOLS_DIR/downloaded"
[ ! -d "$DL_DIR" ] && echo "Error: 'tools/downloaded' directory does not exist. Run tools/download-all.sh" && exit 1
[ ! "$(ls -A "$DL_DIR")" ] && echo "Error: 'tools/downloaded' directory is empty. Run tools/download-all.sh" && exit 2
2022-10-22 09:02:36 +00:00
for file in $TOOLS_DIR/downloaded/*; do
$TOOLS_DIR/find-in-pls.sh "$1" "$file"
done