From 78efd05d66869468867ac2119edce62b4902ebd4 Mon Sep 17 00:00:00 2001 From: ngfchl Date: Wed, 24 Aug 2022 21:02:09 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E9=87=8D=E6=96=B0=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=202.=20=E8=B0=83=E6=95=B4=E4=B8=BA=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=EF=BC=8C=E4=BC=98=E5=8C=96=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=203.=20=E6=B7=BB=E5=8A=A0=E6=8C=87=E5=AE=9A=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E7=AB=AF=E5=8F=A3=E7=9A=84=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F?= =?UTF-8?q?=204.=20=E4=BF=AE=E5=A4=8D=E8=8E=B7=E5=8F=96=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BF=94=E5=9B=9E=E5=80=BC=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- auto_pt/views.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/auto_pt/views.py b/auto_pt/views.py index 8bfd410..794246a 100644 --- a/auto_pt/views.py +++ b/auto_pt/views.py @@ -1,4 +1,5 @@ import json +import os import subprocess from datetime import datetime @@ -84,7 +85,7 @@ def do_restart(request): try: print('重启') # print(os.system('pwd')) - subprocess.Popen('chmod +x ./update.sh') + subprocess.Popen('chmod +x ./update.sh', shell=True) subprocess.Popen('./restart.sh') return JsonResponse(data=CommonResponse.success( msg='重启指令发送成功!!' @@ -98,8 +99,8 @@ def do_restart(request): def do_update(request): try: print('更新') - # print(os.system('pwd')) - p = subprocess.Popen('chmod +x ./update.sh') + print(os.system('cat ./update.sh')) + p = subprocess.Popen('chmod +x ./update.sh', shell=True) subprocess.Popen('./update.sh') p.wait()