You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rosenrot/rosenrot-mklink

18 lines
358 B

#!/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
}