Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

CC-2697: airtime-user script is not working

-added script to system path
  • Loading branch information...
commit a47044c50cbbcaeebfdbf5e3263aec855a04ecbf 1 parent e53c6d8
martin authored
View
4 install_minimal/include/AirtimeInstall.php
@@ -341,6 +341,10 @@ public static function CreateSymlinksToUtils()
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()
View
8 install_minimal/upgrades/airtime-1.9.0/airtime-upgrade.php
@@ -20,6 +20,14 @@
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;
View
2  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`
View
34 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
View
26 utils/airtime-user.php 100755 → 100644
@@ -1,12 +1,14 @@
-#!/usr/bin/php
<?php
-set_include_path('../airtime_mvc/application/models' . PATH_SEPARATOR . get_include_path());
-require_once(__DIR__.'/../airtime_mvc/library/propel/runtime/lib/Propel.php');
-Propel::init(__DIR__.'/../airtime_mvc/application/configs/airtime-conf.php');
+$airtimeIni = GetAirtimeConf();
+$airtime_base_dir = $airtimeIni['general']['airtime_dir'];
-require_once(dirname(__FILE__).'/../airtime_mvc/application/configs/conf.php');
-require_once(dirname(__FILE__).'/../airtime_mvc/application/models/Users.php');
+set_include_path("$airtime_base_dir/application/models" . PATH_SEPARATOR . get_include_path());
+require_once("$airtime_base_dir/library/propel/runtime/lib/Propel.php");
+Propel::init("$airtime_base_dir/application/configs/airtime-conf.php");
+
+require_once("$airtime_base_dir/application/configs/conf.php");
+require_once("$airtime_base_dir/application/models/Users.php");
require_once('DB.php');
require_once('Console/Getopt.php');
@@ -117,3 +119,15 @@ function printUsage()
$user->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;
+}
Please sign in to comment.
Something went wrong with that request. Please try again.