From a47044c50cbbcaeebfdbf5e3263aec855a04ecbf Mon Sep 17 00:00:00 2001 From: martin Date: Fri, 19 Aug 2011 17:05:29 -0400 Subject: [PATCH] CC-2697: airtime-user script is not working -added script to system path --- install_minimal/include/AirtimeInstall.php | 4 +++ .../airtime-1.9.0/airtime-upgrade.php | 8 +++++ utils/airtime-check-system | 2 +- utils/airtime-user | 34 +++++++++++++++++++ utils/airtime-user.php | 26 ++++++++++---- 5 files changed, 67 insertions(+), 7 deletions(-) create mode 100755 utils/airtime-user mode change 100755 => 100644 utils/airtime-user.php diff --git a/install_minimal/include/AirtimeInstall.php b/install_minimal/include/AirtimeInstall.php index 78371447f..50da8b498 100644 --- a/install_minimal/include/AirtimeInstall.php +++ b/install_minimal/include/AirtimeInstall.php @@ -341,6 +341,10 @@ class AirtimeInstall echo "* Installing airtime-check-system".PHP_EOL; $dir = AirtimeInstall::CONF_DIR_BINARIES."/utils/airtime-check-system"; exec("ln -s $dir /usr/bin/airtime-check-system"); + + echo "* Installing airtime-user".PHP_EOL; + $dir = AirtimeInstall::CONF_DIR_BINARIES."/utils/airtime-user"; + exec("ln -s $dir /usr/bin/airtime-user"); } public static function RemoveSymlinks() diff --git a/install_minimal/upgrades/airtime-1.9.0/airtime-upgrade.php b/install_minimal/upgrades/airtime-1.9.0/airtime-upgrade.php index dfaff0944..db7e97bb9 100644 --- a/install_minimal/upgrades/airtime-1.9.0/airtime-upgrade.php +++ b/install_minimal/upgrades/airtime-1.9.0/airtime-upgrade.php @@ -20,6 +20,14 @@ const CONF_DIR_BINARIES = "/usr/lib/airtime"; class AirtimeInstall{ const CONF_DIR_LOG = "/var/log/airtime"; + const CONF_DIR_BINARIES = "/usr/lib/airtime"; + + public static function CreateSymlinksToUtils() + { + echo "* Installing airtime-user".PHP_EOL; + $dir = AirtimeInstall::CONF_DIR_BINARIES."/utils/airtime-user"; + exec("ln -s $dir /usr/bin/airtime-user"); + } public static function CreateZendPhpLogFile(){ global $CC_CONFIG; diff --git a/utils/airtime-check-system b/utils/airtime-check-system index 7a67e6845..164fac6f9 100755 --- a/utils/airtime-check-system +++ b/utils/airtime-check-system @@ -21,7 +21,7 @@ # #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- -# This script cleans audio files in Airtime. +# This script for a correct system environment for Airtime. # # Absolute path to this script SCRIPT=`readlink -f $0` diff --git a/utils/airtime-user b/utils/airtime-user new file mode 100755 index 000000000..b6a30ac17 --- /dev/null +++ b/utils/airtime-user @@ -0,0 +1,34 @@ +#!/bin/bash +#------------------------------------------------------------------------------- +# Copyright (c) 2010 Sourcefabric O.P.S. +# +# This file is part of the Airtime project. +# http://airtime.sourcefabric.org/ +# +# Airtime is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# Airtime is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Airtime; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------- +# This script creates users in Airtime. +# +# Absolute path to this script +SCRIPT=`readlink -f $0` +# Absolute directory this script is in +SCRIPTPATH=`dirname $SCRIPT` + +invokePwd=$PWD +cd $SCRIPTPATH + +php -q airtime-user.php "$@" || exit 1 diff --git a/utils/airtime-user.php b/utils/airtime-user.php old mode 100755 new mode 100644 index dde37242e..30ad66c39 --- a/utils/airtime-user.php +++ b/utils/airtime-user.php @@ -1,12 +1,14 @@ -#!/usr/bin/php delete(); } } + +function GetAirtimeConf() +{ + $ini = parse_ini_file("/etc/airtime/airtime.conf", true); + + if ($ini === false){ + echo "Error reading /etc/airtime/airtime.conf.".PHP_EOL; + exit; + } + + return $ini; +}