@@ -15,10 +15,9 @@ panel_init(){
15
15
panel_path=/www/server/panel
16
16
pidfile=$panel_path /logs/panel.pid
17
17
cd $panel_path
18
- env_path=$panel_path /pyenv/bin/activate
18
+ env_path=$panel_path /pyenv/bin/python3
19
19
if [ -f $env_path ]; then
20
- source $env_path
21
- pythonV=$panel_path /pyenv/bin/python
20
+ pythonV=$panel_path /pyenv/bin/python3
22
21
chmod -R 700 $panel_path /pyenv/bin
23
22
else
24
23
pythonV=/usr/bin/python
@@ -67,7 +66,7 @@ panel_start()
67
66
rm -f $pidfile
68
67
panel_port_check
69
68
echo -e " Starting Bt-Panel...\c"
70
- nohup $panel_path /BT-Panel >> /dev/null 2>&1 &
69
+ nohup $panel_path /BT-Panel >> $log_file 2>&1 &
71
70
isStart=" "
72
71
n=0
73
72
while [[ " $isStart " == " " ]];
@@ -263,21 +262,30 @@ panel_reload()
263
262
264
263
install_used ()
265
264
{
266
- if [ ! -f $panel_path /aliyun.pl ]; then
267
- return ;
265
+ if [ -f $panel_path /aliyun.pl ]; then
266
+ password=$( cat /dev/urandom | head -n 16 | md5sum | head -c 12)
267
+ username=$( $pythonV $panel_path /tools.py panel $password )
268
+ echo " $password " > $panel_path /default.pl
269
+ rm -f $panel_path /aliyun.pl
268
270
fi
269
- password=$( cat /dev/urandom | head -n 16 | md5sum | head -c 12)
270
- username=$( $pythonV $panel_path /tools.py panel $password )
271
- echo " $password " > $panel_path /default.pl
272
- rm -f $panel_path /aliyun.pl
273
271
274
- if [ ! -f $panel_path /php_mysql_auto.pl ]; then
275
- return ;
272
+ if [ -f $panel_path /php_mysql_auto.pl ]; then
273
+ bash $panel_path /script/mysql_auto.sh & > /dev/null
274
+ bash $panel_path /script/php_auto.sh & > /dev/null
275
+ rm -f $panel_path /php_mysql_auto.pl
276
276
fi
277
277
278
- bash $panel_path /script/mysql_auto.sh & > /dev/null
279
- bash $panel_path /script/php_auto.sh & > /dev/null
280
- rm -f $panel_path /php_mysql_auto.pl
278
+ pip_file=/www/server/panel/pyenv/bin/pip3
279
+ python_file=/www/server/panel/pyenv/bin/python3
280
+ if [ -f $pip_file ]; then
281
+ is_rep=$( ls -l /usr/bin/btpip| grep pip3.)
282
+ if [ " ${is_rep} " != " " ]; then
283
+ rm -f /usr/bin/btpip /usr/bin/btpython
284
+ ln -sf $pip_file /usr/bin/btpip
285
+ ln -sf $python_file /usr/bin/btpython
286
+ fi
287
+ fi
288
+
281
289
}
282
290
283
291
error_logs ()
@@ -296,7 +304,7 @@ case "$1" in
296
304
;;
297
305
' restart' )
298
306
panel_stop
299
- sleep 1
307
+ sleep 1
300
308
panel_start
301
309
;;
302
310
' reload' )
@@ -348,3 +356,4 @@ case "$1" in
348
356
$pythonV $panel_path /tools.py cli $1
349
357
;;
350
358
esac
359
+
0 commit comments