aboutsummaryrefslogtreecommitdiff
path: root/rose-mklink
blob: eb878cf2b956dfc2adba65f991d9ba6341928c29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/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
}