From edaa2ead85ffcc46c7651382934e3ea327f75ecd Mon Sep 17 00:00:00 2001 From: Robbt Date: Fri, 3 Jan 2020 20:14:02 -0500 Subject: [PATCH] fixed new line in php --- airtime_mvc/public/setup/database-setup.php | 5 ++++- install | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/public/setup/database-setup.php b/airtime_mvc/public/setup/database-setup.php index 87f5c839c..1fa894255 100644 --- a/airtime_mvc/public/setup/database-setup.php +++ b/airtime_mvc/public/setup/database-setup.php @@ -184,7 +184,10 @@ class DatabaseSetup extends Setup { if (!file_exists(LIBRETIME_CONF_DIR . '/icecast_pass')) { throw new AirtimeDatabaseException("The Icecast Password file was not accessible", array()); }; - $icecast_pass = file_get_contents(LIBRETIME_CONF_DIR . '/icecast_pass', true); + $icecast_pass_txt = file(LIBRETIME_CONF_DIR . '/icecast_pass'); + $icecast_pass = $icecast_pass_txt[0]; + $icecast_pass = str_replace(PHP_EOL, '', $icecast_pass); + error_log($icecast_pass); $statement = self::$dbh->prepare("UPDATE cc_stream_setting SET value = :icecastpass WHERE keyname = 's1_pass'"); $statement->bindValue(':icecastpass', $icecast_pass, PDO::PARAM_STR); try { diff --git a/install b/install index b1b8a1f42..897adae30 100755 --- a/install +++ b/install @@ -894,7 +894,7 @@ if [ "$icecast" = "t" ]; then else icecast_unit_name="icecast" fi - icecast_pass=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-12};echo;) + icecast_pass=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-12};) echo $icecast_pass > /tmp/icecast_pass xmlstarlet ed --inplace -u /icecast/authentication/source-password -v $icecast_pass /etc/icecast2/icecast.xml xmlstarlet ed --inplace -u /icecast/authentication/relay-password -v $icecast_pass /etc/icecast2/icecast.xml