aboutsummaryrefslogtreecommitdiff
path: root/rosenrot-mklink
diff options
context:
space:
mode:
authorNunoSempere <nuno.semperelh@protonmail.com>2024-03-14 15:47:36 -0300
committerNunoSempere <nuno.semperelh@protonmail.com>2024-03-14 15:47:36 -0300
commitd6456e4357a1d2f1480f4ac14e1e00ddba2644b4 (patch)
tree7d5cbd5b2d0f789207d129c048eff00f4d272a73 /rosenrot-mklink
parent94326a8cad79aad2fd89d45503ada0455d644756 (diff)
cleanup & change binary name to rosenrot
Diffstat (limited to 'rosenrot-mklink')
-rwxr-xr-xrosenrot-mklink17
1 files changed, 17 insertions, 0 deletions
diff --git a/rosenrot-mklink b/rosenrot-mklink
new file mode 100755
index 0000000..d8f5be6
--- /dev/null
+++ b/rosenrot-mklink
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+test "$1" = "--help" || test -z "$1" && {
+ printf "%s\n" "usage: rosenrot-mklink <alias> <url>" \
+ "Create a /usr/bin link to a website."
+ exit
+}
+
+test -z "$2" || {
+ test -f "/usr/bin/$1" && {
+ echo "/usr/bin/$1 already exists, remove it first"
+ exit 1
+ }
+
+ printf "#!/bin/sh\n\nrosenrot %s" "$2" > /usr/bin/$1
+ chmod +x /usr/bin/$1
+}