Use constants in the iptv scripts

This commit is contained in:
coolneng 2022-12-05 11:52:50 +01:00
parent 0d0b51fb09
commit 0e9d6ac325
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 9 additions and 6 deletions

View File

@ -1,5 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
DOCKER_IMAGE=magnetikonline/acestream-server:3.1.49_debian_8.11
PORT=6878
select_channel() { select_channel() {
channel_list=( channel_list=(
"Gol TV" "Gol TV"
@ -11,14 +14,14 @@ select_channel() {
channel_selection "$channel" channel_selection "$channel"
} }
manage_session() { streaming_server() {
if [ "$1" = "start" ]; then 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" \ --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" echo "Server started"
else 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" echo "Server stopped"
fi fi
} }
@ -36,6 +39,6 @@ channel_selection() {
esac esac
} }
manage_session "start" streaming_server "start"
select_channel "$@" select_channel "$@"
manage_session "stop" streaming_server "stop"