summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/completions/_initd10
-rw-r--r--etc/function5
2 files changed, 15 insertions, 0 deletions
diff --git a/etc/completions/_initd b/etc/completions/_initd
new file mode 100644
index 0000000..94bc14b
--- /dev/null
+++ b/etc/completions/_initd
@@ -0,0 +1,10 @@
+#compdef Start Restart Stop Reload Zap
+## vim:ft=zsh
+
+local arguments
+
+arguments=(
+ '*:file:_path_files -W /etc/init.d'
+)
+
+_arguments -s $arguments
diff --git a/etc/function b/etc/function
index 90d709d..45a15e7 100644
--- a/etc/function
+++ b/etc/function
@@ -1,3 +1,8 @@
for i in $ZDIR/functions/*; {
autoload $i:t
}
+
+# from https://git.tabularazor.org/~mikael/etc/tree/zsh/functions
+for action in Start Restart Stop Reload Zap; {
+ eval "$action() { sudo /etc/init.d/\$1 ${action:l} ; }"
+}