diff options
author | NunoSempere <nuno.sempere@protonmail.com> | 2023-03-28 11:18:54 -0600 |
---|---|---|
committer | NunoSempere <nuno.sempere@protonmail.com> | 2023-03-28 11:18:54 -0600 |
commit | ca59138a2aef96960381f986b8c683634e4d8e63 (patch) | |
tree | 16c62f8a2b3bfe7ad55053294095f70a85d19613 /build/rose-mklink | |
parent | cc959fda4fac18f1c429158d1ffea24692276310 (diff) |
tweak: move things around
Diffstat (limited to 'build/rose-mklink')
-rwxr-xr-x | build/rose-mklink | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/build/rose-mklink b/build/rose-mklink new file mode 100755 index 0000000..f016aae --- /dev/null +++ b/build/rose-mklink @@ -0,0 +1,17 @@ +#!/bin/sh + +test "$1" = "--help" || test -z "$1" && { + printf "%s\n" "usage: rose-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\nrose %s" "$2" > /usr/bin/$1 + chmod +x /usr/bin/$1 +} |