From 0e9d6ac3254856f9430e396548b7db6c3516df33 Mon Sep 17 00:00:00 2001 From: coolneng Date: Mon, 5 Dec 2022 11:52:50 +0100 Subject: [PATCH] Use constants in the iptv scripts --- scripts/.local/share/scripts/iptv | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/.local/share/scripts/iptv b/scripts/.local/share/scripts/iptv index 4f563ce..dc4f245 100755 --- a/scripts/.local/share/scripts/iptv +++ b/scripts/.local/share/scripts/iptv @@ -1,5 +1,8 @@ #!/usr/bin/env bash +DOCKER_IMAGE=magnetikonline/acestream-server:3.1.49_debian_8.11 +PORT=6878 + select_channel() { channel_list=( "Gol TV" @@ -11,14 +14,14 @@ select_channel() { channel_selection "$channel" } -manage_session() { +streaming_server() { if [ "$1" = "start" ]; then - docker run --publish "6878:6878" --rm --tmpfs "/dev/disk/by-id:noexec,rw,size=4k" \ + docker run --publish "$PORT:$PORT" --rm --tmpfs "/dev/disk/by-id:noexec,rw,size=4k" \ --tmpfs "/root/ACEStream:noexec,rw,size=4096m" \ - magnetikonline/acestream-server:3.1.49_debian_8.11 >/dev/null 2>&1 + $DOCKER_IMAGE >/dev/null 2>&1 echo "Server started" else - docker stop magnetikonline/acestream-server:3.1.49_debian_8.11 >/dev/null 2>&1 + docker stop $DOCKER_IMAGE >/dev/null 2>&1 echo "Server stopped" fi } @@ -36,6 +39,6 @@ channel_selection() { esac } -manage_session "start" +streaming_server "start" select_channel "$@" -manage_session "stop" +streaming_server "stop"