rosenrot/rose-mklink
bellrise 00b64b6ee5
nativefier: Rename to rose-mklink so its easier to grasp
Added a slightly more telling helppage, add added chmod +x /usr/bin/x
so the link may actually be called.
2022-11-19 14:37:13 +01:00

17 lines
347 B
Bash
Executable File

#!/bin/sh
if [ "$1" = "--help" ] || [ -z "$1" ]; then
echo -e "usage: rose-mklink <alias> <url>\n"
echo "Create a /usr/bin link to a website."
fi
test -z "$1" || 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" > /usr/bin/$1
chmod +x /usr/bin/$1
}