add extract ports script
This commit is contained in:
parent
e89a070ad3
commit
4f278ad3ce
2 changed files with 15 additions and 1 deletions
14
extract_ports.sh
Executable file
14
extract_ports.sh
Executable file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Funktion zum Extrahieren der linken Port-Bereiche aus docker-compose.yml-Dateien
|
||||||
|
extract_ports() {
|
||||||
|
local file=$1
|
||||||
|
# Verwende grep und awk, um die linken Port-Bereiche zu extrahieren
|
||||||
|
grep -E '^\s*- "?[0-9]+:[0-9]+"' "$file" | awk -F '[:-]' '{print $2}'
|
||||||
|
}
|
||||||
|
|
||||||
|
# Rekursive Suche nach docker-compose.yml-Dateien und Extraktion der Ports
|
||||||
|
find . -name "docker-compose.yml" | while read -r file; do
|
||||||
|
echo "Datei: $file"
|
||||||
|
extract_ports "$file"
|
||||||
|
done
|
|
@ -16,7 +16,7 @@ extra="$3"
|
||||||
|
|
||||||
[[ -z "${url}" ]] && read -p "URL: " url
|
[[ -z "${url}" ]] && read -p "URL: " url
|
||||||
[[ -z "${format}" ]] && read -p "Format [opus/flac/m4a/mp4/video/hd/fullhd/4k]: " format
|
[[ -z "${format}" ]] && read -p "Format [opus/flac/m4a/mp4/video/hd/fullhd/4k]: " format
|
||||||
echo "Wenn man für alle Playlisten Unterordner anlegen will: [-o %(playlist_title)s/%(title)s.%(ext)s] (Praktisch für Downloads ganzer Kanäle"
|
echo "Wenn man für alle Playlisten Unterordner anlegen will: [-o %(playlist_title)s/%(title)s.%(ext)s/--cookies cookies.txt/--cookies-from-browser firefox] (Praktisch für Downloads ganzer Kanäle"
|
||||||
[[ -z "${extra}" ]] && read -p "Sind noch zusätzliche Parameter gewünscht?: " extra
|
[[ -z "${extra}" ]] && read -p "Sind noch zusätzliche Parameter gewünscht?: " extra
|
||||||
|
|
||||||
if [ "$format" == "opus" ]
|
if [ "$format" == "opus" ]
|
||||||
|
|
Loading…
Reference in a new issue