rosenrot-mklink (358B)
1 #!/bin/sh 2 3 test "$1" = "--help" || test -z "$1" && { 4 printf "%s\n" "usage: rosenrot-mklink <alias> <url>" \ 5 "Create a /usr/bin link to a website." 6 exit 7 } 8 9 test -z "$2" || { 10 test -f "/usr/bin/$1" && { 11 echo "/usr/bin/$1 already exists, remove it first" 12 exit 1 13 } 14 15 printf "#!/bin/sh\n\nrosenrot %s" "$2" > /usr/bin/$1 16 chmod +x /usr/bin/$1 17 }