From 38a07950d429136477fab6164936a0212cd57064 Mon Sep 17 00:00:00 2001 From: Doctor Date: Sun, 23 Jan 2022 14:45:21 +0100 Subject: [PATCH] Add environment for variables with default values --- plugins/teamspeak/teamspeak_user | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/plugins/teamspeak/teamspeak_user b/plugins/teamspeak/teamspeak_user index beba06ea..d49f4a12 100755 --- a/plugins/teamspeak/teamspeak_user +++ b/plugins/teamspeak/teamspeak_user @@ -24,12 +24,11 @@ use strict; use Net::Telnet; # CONFIG HERE! -my $hostname = "localhost"; # serveraddress -my $port = 10011; # querryport (default: 10011) -my @serverids = (1); # array of virtualserverids (1,2,3,4,...) - -my $username = ""; # only set if the default queryuser hasn't enough rights (should work without this) -my $password = ""; +my $hostname = $ENV{hostname} || "localhost"; # serveraddress +my $port = $ENV{port} || 10011; # querryport (default: 10011) +my @serverids = $ENV{serverids} || (1); # array of virtualserverids (1,2,3,4,...) +my $username = $ENV{username} || ""; # only set if the default queryuser hasn't enough rights (should work without this) +my $password = $ENV{password} || ""; # SCRIPT START! if(exists $ARGV[0] and $ARGV[0] eq "config")