mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
Update index.py
This commit is contained in:
+10
-9
@@ -64,28 +64,29 @@ def status():
|
|||||||
return 'start'
|
return 'start'
|
||||||
|
|
||||||
|
|
||||||
def pm2NVMDir():
|
def rootDir():
|
||||||
path = '/root/.nvm'
|
path = '/root'
|
||||||
if public.isAppleSystem():
|
if public.isAppleSystem():
|
||||||
user = public.execShell(
|
user = public.execShell(
|
||||||
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
|
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
|
||||||
path = '/Users/' + user + '/.nvm'
|
path = '/Users/' + user
|
||||||
|
return path
|
||||||
|
|
||||||
|
|
||||||
|
def pm2NVMDir():
|
||||||
|
path = rootDir() + '/.nvm'
|
||||||
return path
|
return path
|
||||||
|
|
||||||
__SR = '''#!/bin/bash
|
__SR = '''#!/bin/bash
|
||||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||||
export PATH
|
export PATH
|
||||||
export HOME=%s
|
export HOME=%s
|
||||||
source %s/nvm.sh && ''' % (getServerDir(), pm2NVMDir())
|
source %s/nvm.sh && ''' % (rootDir(), pm2NVMDir())
|
||||||
__path = getServerDir() + '/list'
|
__path = getServerDir() + '/list'
|
||||||
|
|
||||||
|
|
||||||
def pm2LogDir():
|
def pm2LogDir():
|
||||||
path = '/root/.pm2'
|
path = rootDir() + '/.pm2'
|
||||||
if public.isAppleSystem():
|
|
||||||
user = public.execShell(
|
|
||||||
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
|
|
||||||
path = '/Users/' + user + '/.pm2'
|
|
||||||
return path
|
return path
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user