-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbits-installer
More file actions
49 lines (41 loc) · 940 Bytes
/
bits-installer
File metadata and controls
49 lines (41 loc) · 940 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
bits_parse_params()
{
while
(( $# > 0 ))
do
token="$1"
shift
case "$token" in
(--path)
if [[ -n "${1:-}" ]]
then
bits_path="$1"
shift
else
fail "--path must be followed by a path, e.g. /usr/local/bin."
fi
;;
(--bits)
if [[ -n "${1:-}" ]]
then
bits_filename="$1"
shift
else
fail "--bits must be followed by a filename, e.g. /usr/local/bin/bits"
fi
;;
esac
done
bits_path=${bits_path-/usr/local/bin}
bits_filename=${bits_filename-${bits_path}/bits}
}
do_install()
{
bits_parse_params "$@"
echo "Installing bits into \"$bits_filename\""
curl -s -o "$bits_filename" https://raw.githubusercontent.com/capbash/bits/master/bits
chmod 755 "${bits_filename}"
echo "Done, to uninstall 'rm \"${bits_filename}\"'."
}
do_install "$@"