summaryrefslogtreecommitdiffstats
path: root/retiolum/scripts/autostart/create-startup.sh
diff options
context:
space:
mode:
authorroot <root@filebitch>2011-08-16 19:10:17 +0200
committerroot <root@filebitch>2011-08-16 19:10:17 +0200
commit460982f036bdc4815ea5e9447392bdb049ff2a87 (patch)
treeb27e2e3cb28b8b4ecbb3e9ba2004966241262c85 /retiolum/scripts/autostart/create-startup.sh
parent9a9ff1d97fa5072109a4381484f5daf5a4bfb0c1 (diff)
parent84f25017f61d87c592bcc4519bee56e49fe66083 (diff)
Merge branch 'master' of https://github.com/krebscode/painload
Diffstat (limited to 'retiolum/scripts/autostart/create-startup.sh')
-rwxr-xr-xretiolum/scripts/autostart/create-startup.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/retiolum/scripts/autostart/create-startup.sh b/retiolum/scripts/autostart/create-startup.sh
new file mode 100755
index 00000000..37edb972
--- /dev/null
+++ b/retiolum/scripts/autostart/create-startup.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+if test "${nosudo-false}" != true -a `id -u` != 0; then
+ echo "we're going sudo..." >&2
+ exec sudo "$0" "$@"
+ exit 23 # go to hell
+fi
+
+readlink="`readlink -f "$0"`"
+dirname="`dirname "$0"`"
+cd "$dirname"
+
+if [ -e /etc/init.d ];then
+ INIT_FOLDER=/etc/init.d
+ update-rc.d tinc defaults #TODO debian specific
+else
+ INIT_FOLDER=/etc/rc.d
+ echo "add tinc to DAEMONS in /etc/rc.conf" #TODO archlinux specific
+fi
+
+echo "retiolum" > /etc/tinc/nets.boot
+cp -a tinc $INIT_FOLDER
[cgit] Unable to lock slot /tmp/cgit/53200000.lock: Permission denied (13)