parent
4c9c86bf4f
commit
d516b963e4
|
@ -53,7 +53,11 @@ if(isset($version) && ($version != false) && ($version == AIRTIME_VERSION) && !i
|
||||||
if(isset($version) && ($version != false) && ($version < AIRTIME_VERSION)) {
|
if(isset($version) && ($version != false) && ($version < AIRTIME_VERSION)) {
|
||||||
echo "Airtime version $version found.".PHP_EOL;
|
echo "Airtime version $version found.".PHP_EOL;
|
||||||
require_once("airtime-upgrade.php");
|
require_once("airtime-upgrade.php");
|
||||||
exit(1);
|
|
||||||
|
//Make sure to exit with non-zero error code so that airtime-install
|
||||||
|
//shell script does not continue with installing pypo, show-recorder,
|
||||||
|
//media-monitor etc.
|
||||||
|
exit(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
|
|
|
@ -11,10 +11,38 @@ require_once __DIR__.'/../../../airtime_mvc/application/configs/conf.php';
|
||||||
require_once(dirname(__FILE__).'/../../include/AirtimeInstall.php');
|
require_once(dirname(__FILE__).'/../../include/AirtimeInstall.php');
|
||||||
require_once(dirname(__FILE__).'/../../include/AirtimeIni.php');
|
require_once(dirname(__FILE__).'/../../include/AirtimeIni.php');
|
||||||
|
|
||||||
// clean up old files
|
|
||||||
@unlink('/usr/bin/airtime-pypo-start');
|
|
||||||
@unlink('/usr/bin/airtime-pypo-stop');
|
|
||||||
@unlink(dirname(__FILE__).'/../../../python_apps/pypo/airtime-pypo-start');
|
|
||||||
@unlink(dirname(__FILE__).'/../../../python_apps/pypo/airtime-pypo-stop');
|
|
||||||
|
|
||||||
AirtimeInstall::CreateZendPhpLogFile();
|
AirtimeInstall::CreateZendPhpLogFile();
|
||||||
|
|
||||||
|
|
||||||
|
/* In version 1.9.0 we have have switched from daemontools to more traditional
|
||||||
|
* init.d daemon system. Let's remove all the daemontools files
|
||||||
|
*/
|
||||||
|
|
||||||
|
exec("airtime-pypo-stop");
|
||||||
|
exec("airtime-show-recorder-stop");
|
||||||
|
exec("airtime-media-monitor-stop");
|
||||||
|
|
||||||
|
$pathnames = array("/usr/bin/airtime-pypo-start",
|
||||||
|
"/usr/bin/airtime-pypo-stop",
|
||||||
|
"/usr/bin/airtime-show-recorder-start",
|
||||||
|
"/usr/bin/airtime-show-recorder-stop",
|
||||||
|
"/usr/bin/airtime-media-monitor-start",
|
||||||
|
"/usr/bin/airtime-media-monitor-stop",
|
||||||
|
"/etc/service/pypo",
|
||||||
|
"/etc/service/pypo-liquidsoap",
|
||||||
|
"/etc/service/media-monitor",
|
||||||
|
"/etc/service/recorder",
|
||||||
|
"/var/log/airtime/pypo/main",
|
||||||
|
"/var/log/airtime/show-recorder/main"
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach ($pathnames as $pn){
|
||||||
|
exec("rm -rf ".$pn);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Run install scripts for pypo, show-recorder and media-monitor.
|
||||||
|
* This is to install the init.d scripts. */
|
||||||
|
exec("python ".__DIR__."/../../../python_apps/pypo/install/pypo-install.py");
|
||||||
|
exec("python ".__DIR__."/../../../python_apps/show-recorder/install/recorder-install.py");
|
||||||
|
exec("python ".__DIR__."/../../../python_apps/media-monitor/install/media-monitor-install.py");
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ try:
|
||||||
|
|
||||||
current_script_dir = get_current_script_dir()
|
current_script_dir = get_current_script_dir()
|
||||||
|
|
||||||
p = Popen("/etc/init.d/airtime-media-monitor stop", shell=True)
|
p = Popen("/etc/init.d/airtime-media-monitor stop >/dev/null 2>&1", shell=True)
|
||||||
sts = os.waitpid(p.pid, 0)[1]
|
sts = os.waitpid(p.pid, 0)[1]
|
||||||
|
|
||||||
print "Creating log directories"
|
print "Creating log directories"
|
||||||
|
@ -82,6 +82,4 @@ try:
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print "exception:" + str(e)
|
print "exception:" + str(e)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,6 @@ def create_path(path):
|
||||||
if not (os.path.exists(path)):
|
if not (os.path.exists(path)):
|
||||||
print "Creating directory " + path
|
print "Creating directory " + path
|
||||||
os.makedirs(path)
|
os.makedirs(path)
|
||||||
else:
|
|
||||||
print "Directory already exists " + path
|
|
||||||
|
|
||||||
def copy_dir(src_dir, dest_dir):
|
def copy_dir(src_dir, dest_dir):
|
||||||
if (os.path.exists(dest_dir)) and (dest_dir != "/"):
|
if (os.path.exists(dest_dir)) and (dest_dir != "/"):
|
||||||
|
@ -62,7 +60,7 @@ try:
|
||||||
|
|
||||||
current_script_dir = get_current_script_dir()
|
current_script_dir = get_current_script_dir()
|
||||||
|
|
||||||
p = Popen("/etc/init.d/airtime-playout stop", shell=True)
|
p = Popen("/etc/init.d/airtime-playout stop >/dev/null 2>&1", shell=True)
|
||||||
sts = os.waitpid(p.pid, 0)[1]
|
sts = os.waitpid(p.pid, 0)[1]
|
||||||
|
|
||||||
create_path(config["pypo_log_dir"])
|
create_path(config["pypo_log_dir"])
|
||||||
|
@ -111,7 +109,6 @@ try:
|
||||||
os.system("rm -f /usr/bin/airtime-liquidsoap")
|
os.system("rm -f /usr/bin/airtime-liquidsoap")
|
||||||
os.system("ln -s "+config["bin_dir"]+"/bin/airtime-liquidsoap /usr/bin/")
|
os.system("ln -s "+config["bin_dir"]+"/bin/airtime-liquidsoap /usr/bin/")
|
||||||
|
|
||||||
|
|
||||||
print "Installing pypo daemon"
|
print "Installing pypo daemon"
|
||||||
shutil.copy(config["bin_dir"]+"/bin/airtime-playout-init-d", "/etc/init.d/airtime-playout")
|
shutil.copy(config["bin_dir"]+"/bin/airtime-playout-init-d", "/etc/init.d/airtime-playout")
|
||||||
|
|
||||||
|
@ -126,6 +123,5 @@ try:
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print "exception:" + str(e)
|
print "exception:" + str(e)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ try:
|
||||||
|
|
||||||
current_script_dir = get_current_script_dir()
|
current_script_dir = get_current_script_dir()
|
||||||
|
|
||||||
p = Popen("/etc/init.d/airtime-show-recorder stop", shell=True)
|
p = Popen("/etc/init.d/airtime-show-recorder stop >/dev/null 2>&1", shell=True)
|
||||||
sts = os.waitpid(p.pid, 0)[1]
|
sts = os.waitpid(p.pid, 0)[1]
|
||||||
|
|
||||||
print "Creating temporary media storage directory"
|
print "Creating temporary media storage directory"
|
||||||
|
@ -80,6 +80,4 @@ try:
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print "exception:" + str(e)
|
print "exception:" + str(e)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue