Subversion Repositories php-qbpwcf

Rev

Rev 3 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 liveuser 1
#!/usr/bin/php
2
<?php
3
 
4
#預設 usr/lib 的資料夾為 lib64
5
$folderOfUsrLib="lib64";
6
 
135 liveuser 7
#hardcode it, before mv usr/lib64/* to usr/lib/
8
echo $folderOfUsrLib;exit;
9
 
3 liveuser 10
#取得作業系統資訊
11
exec("cat /proc/version",$output,$status);
12
 
13
#如果取得作業系統資訊失敗
14
if($status!==0){
15
 
16
	#印出錯誤訊息
17
	echo "get OS info failed!".PHP_EOL;
18
 
19
	#結束執行,回傳代碼1給shell
20
	exit(1);
21
 
22
	}#if end
23
 
24
#如果不是 x86_64
25
if(strpos($output[0],".x86_64")===false){
26
 
27
	#debug
28
	#var_dump(__LINE__,$output);
29
 
30
	#印出錯誤訊息
31
	echo "Sorry, QBPWCF only support x86_64 CPU ISA(Instruction set architecture) now!".PHP_EOL;
32
 
33
	#結束執行,回傳代碼1給shell
34
	exit(1);
35
 
36
	}#if end
37
 
38
#印出結果
39
echo $folderOfUsrLib;
40
 
41
?>