summary refs log tree commit diff stats
path: root/zsh/functions/runit/linksv
diff options
context:
space:
mode:
authorAlan Pearce2013-04-28 20:54:18 +0100
committerAlan Pearce2013-04-28 20:54:18 +0100
commite7657d6ba54ad5714657cff9be86ec416d342a4c (patch)
tree50a2fada14e8d5f76ef890c4b860fbdd4faf812f /zsh/functions/runit/linksv
parent6bec14c2d18c915a3510aba36a37e78a8b83170f (diff)
downloaddotfiles-e7657d6ba54ad5714657cff9be86ec416d342a4c.tar.lz
dotfiles-e7657d6ba54ad5714657cff9be86ec416d342a4c.tar.zst
dotfiles-e7657d6ba54ad5714657cff9be86ec416d342a4c.zip
Migrate repository from mercurial without history
Diffstat (limited to 'zsh/functions/runit/linksv')
-rw-r--r--zsh/functions/runit/linksv16
1 files changed, 16 insertions, 0 deletions
diff --git a/zsh/functions/runit/linksv b/zsh/functions/runit/linksv
new file mode 100644
index 0000000..7ee7109
--- /dev/null
+++ b/zsh/functions/runit/linksv
@@ -0,0 +1,16 @@
+#!/usr/bin/env zsh
+
+if [[ -z $1 ]]; then
+	echo "No service specified"
+	return 64
+fi
+
+
+if [[ ! -x $1 ]]; then
+	echo "Service does not exist in current directory"
+	return 1
+fi
+
+mv $1{,.old}
+ln -s =sv $1
+chmod -h a-w $1