summaryrefslogtreecommitdiff
path: root/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'install.sh')
-rw-r--r--install.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/install.sh b/install.sh
new file mode 100644
index 0000000..f109db2
--- /dev/null
+++ b/install.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+installifexists () {
+ if type $1 >/dev/null; then
+ printf "$1 found. Installing service dir to /etc/runit/sv...\n"
+ sudo cp -rn $1 /etc/runit/sv/
+ if [ -n "$(ls -A config/$1)" ]; then
+ printf "and config to /etc...\n"
+ sudo cp -rn config/$1/ /etc/
+ fi
+ fi
+}
+
+printf "Installing services if they exist...\n\n\n"
+
+for i in `ls`; do
+ [ -f "$i" ] && continue
+ [ "$i" = "config" ] && continue
+ printf "$i...\n"
+ installifexists "$i"
+ printf "\n"
+done