Quellcode durchsuchen

install routine deleted - now in ansible

tags/v1.3.0
Dirk Alders vor 1 Jahr
Ursprung
Commit
03e5e29f7b
1 geänderte Dateien mit 0 neuen und 43 gelöschten Zeilen
  1. 0
    43
      __install__.py

+ 0
- 43
__install__.py Datei anzeigen

@@ -1,43 +0,0 @@
1
-#!/bin/python
2
-#
3
-import os
4
-import sys
5
-
6
-SERVICE_FILE = """
7
-[Unit]
8
-Description=Smarthome Ambient Information Service
9
-After=network-online.target
10
-Wants=network-online.target
11
-[Service]
12
-User=%(UID)d
13
-Group=%(GID)d
14
-WorkingDirectory=%(MY_PATH)s
15
-ExecStart=%(MY_PATH)s/smart_brain.sh
16
-Type=simple
17
-[Install]
18
-WantedBy=default.target
19
-"""
20
-
21
-
22
-def help():
23
-    print("Usage: prog <UID> <GID> <TARGET_PATH>")
24
-
25
-
26
-if __name__ == "__main__":
27
-    if len(sys.argv) == 4:
28
-        try:
29
-            uid = int(sys.argv[1])
30
-            gid = int(sys.argv[2])
31
-        except ValueError:
32
-            help()
33
-        else:
34
-            if os.path.isdir(sys.argv[3]):
35
-                with open(os.path.join(sys.argv[3], 'smart_brain.service'), "w") as fh:
36
-                    fh.write(SERVICE_FILE % {
37
-                        "MY_PATH": os.path.dirname(os.path.abspath(__file__)),
38
-                        "UID": uid,
39
-                        "GID": gid})
40
-            else:
41
-                help()
42
-    else:
43
-        help()

Laden…
Abbrechen
Speichern