cc-4227: updated install scripts for upgrade
This commit is contained in:
parent
abeef43a5b
commit
6c1e822b6a
4 changed files with 22 additions and 16 deletions
|
@ -2,6 +2,7 @@ import os
|
|||
import shutil
|
||||
import sys
|
||||
from configobj import ConfigObj
|
||||
import upgrade2dot2
|
||||
|
||||
def get_current_script_dir():
|
||||
return os.path.dirname(os.path.realpath(__file__))
|
||||
|
@ -14,12 +15,14 @@ def copy_dir(src_dir, dest_dir):
|
|||
shutil.copytree(src_dir, dest_dir)
|
||||
|
||||
PATH_INI_FILE = '/etc/airtime/api_client.cfg'
|
||||
|
||||
|
||||
current_script_dir = get_current_script_dir()
|
||||
|
||||
if not os.path.exists(PATH_INI_FILE):
|
||||
shutil.copy('%s/../api_client.cfg'%current_script_dir, PATH_INI_FILE)
|
||||
|
||||
|
||||
upgrade2dot2.upgrade('%s/../api_client.cfg'% current_script_dir, PATH_INI_FILE)
|
||||
|
||||
"""load config file"""
|
||||
try:
|
||||
config = ConfigObj("%s/../api_client.cfg" % current_script_dir)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue