CPanel developer’s note

想不到最近還是有寫程式的機會,XD
目標是:修改httpd.conf , 根據cpanel的user package,來設置cband的quota limit
algorithms:
(1) 由cpanel的api—listaccts
去抓出package ( 看是A, B, C .. )
(2) 對於每一個user
建立資料夾 mkdir -p /usr/local/apache/conf/userdata/std/2/$user
(3) 由每一個user 的package, A —> a.conf
B —> b.conf
將對應的 $package.conf 拷貝到
/usr/local/apache/conf/userdata/std/2/$user/$package.conf
(4) 重新generate /usr/local/apache/conf/httpd.conf
下command /usr/local/cpanel/bin/build_apache_conf