From dee1d31fc0718342e2c75ccc163f5ff12058592b Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 23 Feb 2016 18:29:23 +0800 Subject: [PATCH] =?UTF-8?q?change(with=206be7003)=20=E8=81=94=E5=8A=A8?= =?UTF-8?q?=E6=94=B9=E5=8F=98=E5=AE=89=E8=A3=85=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 为init.sh添加执行权限 2. 统一函数功能 修改其他需要改变权限的脚本或目录 --- install/next.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/install/next.py b/install/next.py index e3dc312fa..48a518b71 100755 --- a/install/next.py +++ b/install/next.py @@ -41,9 +41,6 @@ class Setup(object): version = urllib.urlopen('http://jumpserver.org/version/?id=%s' % mac) except: pass - os.chdir(jms_dir) - os.chmod('logs', 0777) - os.chmod('keys', 0777) def _input_admin(self): while True: @@ -81,16 +78,21 @@ class Setup(object): os.system('id %s &> /dev/null || useradd %s' % (self.admin_user, self.admin_user)) @staticmethod - def _cp_zzsh(): - os.chdir(os.path.join(jms_dir, 'install')) - shutil.copy('zzjumpserver.sh', '/etc/profile.d/') - bash("sed -i 's#/opt/jumpserver#%s#g' /etc/profile.d/zzjumpserver.sh" % jms_dir) + def _chmod_file(): + os.chdir(jms_dir) + os.chmod('init.sh', 0755) + os.chmod('connect.py', 0755) + os.chmod('manage.py', 0755) + os.chmod('run_websocket.py', 0755) + os.chmod('service.sh', 0755) + os.chmod('logs', 0777) + os.chmod('keys', 0777) @staticmethod def _run_service(): os.system('sh %s start' % os.path.join(jms_dir, 'service.sh')) print - color_print('安装成功,请访问web, 祝你使用愉快。\n请访问 https://github.com/ibuler/jumpserver 查看文档', 'green') + color_print('安装成功,请访问web, 祝你使用愉快。\n请访问 https://github.com/jumpserver/jumpserver 查看文档', 'green') def start(self): print "开始安装Jumpserver, 要求环境为 CentOS 6.5 x86_64" @@ -98,7 +100,7 @@ class Setup(object): self._sync_db() self._input_admin() self._create_admin() - self._cp_zzsh() + self._chmod_file() self._run_service()