-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathextend
executable file
·57 lines (46 loc) · 1.11 KB
/
extend
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
50
51
52
53
54
55
56
57
#!/usr/bin/env bash
usage()
{
printf "
Usage:
$0 [--help] extension_name
where extension_name is one of:
$(find * -type d -maxdepth 0)"
}
[[ -s /etc/bdsmrc ]] && source /etc/bdsmrc
[[ -s "$HOME/.bdsmrc" ]] && source "${HOME}/.bdsmrc"
if [[ $UID -eq 0 ]] ; then
true ${bdsm_path:="/usr/local/bdsm"}
else
true ${bdsm_path:="$HOME/.bdsm"}
fi
if [[ -z "$*" ]]; then
printf "\n\n"
fi
while [[ $# -gt 0 ]] ; do
token="$1" ; shift
case "$1" in
--trace)
;;
--help|help)
usage
;;
*)
if [[ -d $token ]] ; then
if [[ ! -d "$bdsm_path/extensions" ]]; then
printf "It appears that BDSM has not been installed to $bdsm_path\n"
if [[ $(id -u) -ne 0 && -d "/usr/local/bdsm" ]]; then
printf "It also appears that you installed BDSM as root, "
printf "please run this script as root in order to install extensions.\n"
fi
exit 1
fi
cp -Rf $token "$bdsm_path/extensions/"
else
printf "$token is an unknown command / extension.\n"
usage
exit 1
fi
esac
done
exit 0