Compare commits
No commits in common. "93d0c87b30c4860fc14155df24252541251a35a8" and "03591e8e9dfa016e87d2c30c281169bb6d63436f" have entirely different histories.
93d0c87b30
...
03591e8e9d
|
@ -8,13 +8,7 @@ import sys
|
||||||
parser = argparse.ArgumentParser(prog='SystemD Service Generator', description='SystemD Service Unit File Generator', epilog='Meow')
|
parser = argparse.ArgumentParser(prog='SystemD Service Generator', description='SystemD Service Unit File Generator', epilog='Meow')
|
||||||
|
|
||||||
parser.add_argument("-i", "--install", nargs='?', const="/etc/systemd/system/", default=None)
|
parser.add_argument("-i", "--install", nargs='?', const="/etc/systemd/system/", default=None)
|
||||||
parser.add_argument("-r", "--restart", default="on-failure")
|
parser.add_argument("service_name", required=("--install" in sys.argv or "-i" in sys.argv), default=None)
|
||||||
parser.add_argument("-w", "--wanted", default="multi-user.target")
|
|
||||||
parser.add_argument("-d", "--working_dir", default=None)
|
|
||||||
parser.add_argument("-u", "--user", default=None)
|
|
||||||
parser.add_argument('-g', "--group", default=None)
|
|
||||||
if "--install" in sys.argv or "-i" in sys.argv:
|
|
||||||
parser.add_argument("service_name", default=None)
|
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
@ -33,23 +27,6 @@ def bprint(*args, **kwargs):
|
||||||
print(*args, file=f, **kwargs)
|
print(*args, file=f, **kwargs)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
description = color_io.input_print("Please enter description")
|
|
||||||
exec_string = color_io.input_print("Please enter execution string")
|
|
||||||
bprint("[Unit]")
|
bprint("[Unit]")
|
||||||
bprint("Description=" + description)
|
description = color_io.input_print("Please enter description: ")
|
||||||
bprint()
|
bprint("")
|
||||||
bprint("[Service]")
|
|
||||||
bprint("Type=exec")
|
|
||||||
if args.working_dir is not None:
|
|
||||||
bprint("WorkingDirectory=" + args.working_dir)
|
|
||||||
if args.user is not None:
|
|
||||||
bprint("User=" + args.user)
|
|
||||||
if args.group is not None:
|
|
||||||
bprint("Group=" + args.group)
|
|
||||||
bprint("ExecStart=" + exec_string)
|
|
||||||
bprint("RestartSec=1s")
|
|
||||||
bprint("Restart=" + args.restart)
|
|
||||||
bprint("OOMPolicy=stop")
|
|
||||||
bprint()
|
|
||||||
bprint("[Install]")
|
|
||||||
bprint("WantedBy=" + args.wanted)
|
|
|
@ -16,7 +16,6 @@ args = parser.parse_args()
|
||||||
f = sys.stdout
|
f = sys.stdout
|
||||||
|
|
||||||
html_base = """
|
html_base = """
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
|
|
Loading…
Reference in New Issue