forked from oZONo32/EHCP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_1.php
executable file
·59 lines (51 loc) · 1.88 KB
/
install_1.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
error_reporting (E_ALL ^ E_NOTICE);
// first part of install.
// this installs mailserver, then, install2 begins,
// i separated these installs because php email function does not work if i re-start php after email install...
if(!function_exists("mysqli_connect")) {
echo "mysqli_connect() function not found. Check your php-mysql installation. This is strange. \n\n";
exit(1);
}
if($argc>1){
# Distro and version are always sent
# Get distro version number
$temp = trim($argv[1]);
if(stripos($temp, ".") != FALSE){
$version = $temp;
}
# Distro is needed for Ubuntu only features
$distro = strtolower(trim($argv[2]));
}
for($i=3;$i<=5;$i++){ # accept following arguments in any of position.
if($argc>$i) {
print "argc:$argc\n\n";
switch($argv[$i]) {
case 'noapt': # for only simulating install, apt-get installs are still loged onto a file
$noapt="noapt";
echo "apt-get install disabled due to parameter:noapt \n";
break;
case 'unattended': # tries to suppress most user dialogs.. good for a quick testing. (tr: hizlica test etmek icin guzel..)
$unattended=True;
echo "============================\n";
echo "Unattended mode enabled...\n" ;
echo "============================\n";
break;
case 'light': # the light install, non-cruical parts are omitted. good for a quick testing. (tr: hizlica test etmek icin guzel..)
$installmode='light';
break;
default:
echo __FILE__." dosyasinda bilinmeyen arguman degeri:".$argv[$i];
break;
}
}
}
echo "Some install parameters for file ".__FILE__.": noapt:($noapt), unattended:".($unattended===True?"exact True":"not True")." installmode:($installmode) \n";
include_once('install_lib.php');
initialize();
echo "\n------\ninstallpath set as: $ehcpinstalldir \n";
installfiles();
installmailserver();
#infomail('_4_ehcp_mailserver,installfiles complete');
passvariablestoinstall2();
?>