rosenrot/rose-mklink

18 lines
355 B
Plaintext
Raw Permalink Normal View History

#!/bin/bash
2022-11-23 16:58:20 +00:00
test "$1" = "--help" || test -z "$1" && {
echo -e "usage: rose-mklink <alias> <url>\n"
echo "Create a /usr/bin link to a website."
2022-11-23 16:58:20 +00:00
exit
}
2022-11-23 16:58:20 +00:00
test -z "$2" || {
[ -f "/usr/bin/$1" ] && {
echo "/usr/bin/$1 already exists, remove it first"
exit 1
}
echo -e "#!/bin/sh\n\nrose $2 > /dev/null &1>2 &" > /usr/bin/$1
chmod +x /usr/bin/$1
}