From 674188d1d88e3432e8035fe5d835de56ce59e1d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=88=98=EC=A4=80?= Date: Mon, 23 Oct 2023 16:54:11 +0900 Subject: [PATCH] FIX: fix test code --- app-setting.sh | 8 +++++--- main.py | 4 ++-- sdt-cloud-app.service | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) 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