]> git.parisson.com Git - mezzo.git/commitdiff
rename install script
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Wed, 20 Jan 2016 18:53:02 +0000 (19:53 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Wed, 20 Jan 2016 18:53:02 +0000 (19:53 +0100)
install_linux_systemd.py [new file with mode: 0755]
install_linux_sysvinit.py [new file with mode: 0755]
install_systemd.py [deleted file]
install_sysv.py [deleted file]

diff --git a/install_linux_systemd.py b/install_linux_systemd.py
new file mode 100755 (executable)
index 0000000..c16df44
--- /dev/null
@@ -0,0 +1,39 @@
+#!/usr/bin/python
+
+import os
+
+path = os.getcwd()
+name = path.split(os.sep)[-1]
+service = '/lib/systemd/system/' + name + '.service'
+
+print 'installing ' + name + '...'
+
+if not os.path.exists('/etc/init.d/docker'):
+    os.system('wget -qO- https://get.docker.com/ | sh')
+    os.system('pip install docker-compose')
+
+rules="""
+[Unit]
+Description=%s composition
+Requires=docker.service
+After=docker.service
+
+[Service]
+ExecStart=/usr/local/bin/docker-compose -f %s/docker-compose.yml up -d
+ExecStop=/usr/local/bin/docker-compose -f %s/docker-compose.yml stop
+
+[Install]
+WantedBy=local.target
+""" % (name, path, path)
+
+# print rules
+
+f = open(service, 'w')
+f.write(rules)
+f.close()
+
+os.system('systemctl enable ' + service)
+os.system('systemctl daemon-reload')
+os.system('systemctl start ' + name)
+
+print 'done'
diff --git a/install_linux_sysvinit.py b/install_linux_sysvinit.py
new file mode 100755 (executable)
index 0000000..8c2cf17
--- /dev/null
@@ -0,0 +1,27 @@
+#!/usr/bin/python
+
+import os
+
+path = os.getcwd()
+name = path.split(os.sep)[-1].lower()
+service = '/etc/init.d/' + name
+conf = path + os.sep + 'docker-compose.yml'
+
+print 'installing ' + name + '...'
+
+if not os.path.exists('/etc/init.d/docker'):
+    os.system('wget -qO- https://get.docker.com/ | sh')
+    os.system('pip install docker-compose')
+
+f = open('init.sh.example', 'r')
+rules = f.read() % (name, name, conf)
+f.close()
+
+f = open(service, 'w')
+f.write(rules)
+f.close()
+
+os.system('chmod 755 ' + service)
+os.system('update-rc.d ' + name + ' defaults')
+
+print 'done'
diff --git a/install_systemd.py b/install_systemd.py
deleted file mode 100755 (executable)
index c16df44..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/python
-
-import os
-
-path = os.getcwd()
-name = path.split(os.sep)[-1]
-service = '/lib/systemd/system/' + name + '.service'
-
-print 'installing ' + name + '...'
-
-if not os.path.exists('/etc/init.d/docker'):
-    os.system('wget -qO- https://get.docker.com/ | sh')
-    os.system('pip install docker-compose')
-
-rules="""
-[Unit]
-Description=%s composition
-Requires=docker.service
-After=docker.service
-
-[Service]
-ExecStart=/usr/local/bin/docker-compose -f %s/docker-compose.yml up -d
-ExecStop=/usr/local/bin/docker-compose -f %s/docker-compose.yml stop
-
-[Install]
-WantedBy=local.target
-""" % (name, path, path)
-
-# print rules
-
-f = open(service, 'w')
-f.write(rules)
-f.close()
-
-os.system('systemctl enable ' + service)
-os.system('systemctl daemon-reload')
-os.system('systemctl start ' + name)
-
-print 'done'
diff --git a/install_sysv.py b/install_sysv.py
deleted file mode 100755 (executable)
index 8c2cf17..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/python
-
-import os
-
-path = os.getcwd()
-name = path.split(os.sep)[-1].lower()
-service = '/etc/init.d/' + name
-conf = path + os.sep + 'docker-compose.yml'
-
-print 'installing ' + name + '...'
-
-if not os.path.exists('/etc/init.d/docker'):
-    os.system('wget -qO- https://get.docker.com/ | sh')
-    os.system('pip install docker-compose')
-
-f = open('init.sh.example', 'r')
-rules = f.read() % (name, name, conf)
-f.close()
-
-f = open(service, 'w')
-f.write(rules)
-f.close()
-
-os.system('chmod 755 ' + service)
-os.system('update-rc.d ' + name + ' defaults')
-
-print 'done'