diff --git a/app-setting.sh b/app-setting.sh index 113cada..96637e0 100755 --- a/app-setting.sh +++ b/app-setting.sh @@ -1,12 +1,14 @@ #!/bin/bash -if [ -z $1 ] || [ -z $2 ] ; then +if [ -z $1 ] || [ -z $2 ] || [ -z $3 ] ; then echo "Please fill in app's name, file." exit fi + + mv sdt-cloud-app.service $1.service sed -i "s/sdt-cloud-app/$1/g" ./install.sh sed -i "s/sdt-cloud-app/$1/g" ./$1.service -sed -i "s/exeFile/$2/g" ./$1.service - +sed -i "s%exePath%$2%g" ./$1.service +sed -i "s/exeFile/$2/g" ./$1.service \ No newline at end of file diff --git a/main.py b/main.py index 9097393..37ac664 100644 --- a/main.py +++ b/main.py @@ -7,10 +7,10 @@ import time import yaml parser = argparse.ArgumentParser() -parser.add_argument('-config',help='') +parser.add_argument('-app',help='') args = parser.parse_args() -with open(f'/usr/local/sdt/app/{args.config}/config.json', encoding='UTF-8') as f: +with open(f'/usr/local/sdt/app/{args.app}/config.json', encoding='UTF-8') as f: jsonData = json.load(f) diff --git a/sdt-cloud-app.service b/sdt-cloud-app.service index 613e59f..a053e9c 100644 --- a/sdt-cloud-app.service +++ b/sdt-cloud-app.service @@ -2,7 +2,7 @@ Description=sdt-cloud-app [Service] -ExecStart=exePath /usr/local/sdt/app/appName/exeFile -config appName +ExecStart=exePath /usr/local/sdt/app/appName/exeFile -app appName Restart=always RestartSec=10