From 85e34709800b808a0187c0966c39f41b491e452d Mon Sep 17 00:00:00 2001 From: huangsimin Date: Fri, 4 Jan 2019 16:41:15 +0800 Subject: [PATCH] add start.py stop.py --- .gitignore | 1 + start.py | 9 +++++++++ stop.py | 8 ++++++++ 3 files changed, 18 insertions(+) create mode 100644 .gitignore create mode 100755 start.py create mode 100755 stop.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cac6822 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +screenlog.* diff --git a/start.py b/start.py new file mode 100755 index 0000000..477f817 --- /dev/null +++ b/start.py @@ -0,0 +1,9 @@ +import glob +import os + +if __name__ == "__main__": + for p in glob.glob("./*"): + if os.path.isdir(p): + bn = os.path.basename(p) + os.system("cd {0} && go build ./ && screen -L -dmS {0} ./{0}".format(bn)) + \ No newline at end of file diff --git a/stop.py b/stop.py new file mode 100755 index 0000000..87a9660 --- /dev/null +++ b/stop.py @@ -0,0 +1,8 @@ +import glob +import os + +if __name__ == "__main__": + for p in glob.glob("./*"): + if os.path.isdir(p): + bn = os.path.basename(p) + os.system("cd {0} && screen -X -S {0} quit ".format(bn)) \ No newline at end of file