rosenrot/rose-mklink
davidovki 122437115d Remove bash-only features for sh scripts
Fix order of CC arguments to aid in linking on newer versions
2023-02-07 11:37:05 +00:00

18 lines
350 B
Bash
Executable File

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