-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·43 lines (32 loc) · 959 Bytes
/
install.sh
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
#!/usr/bin/env bash
function root_setup {
find ./bin/ -type f -exec cp {} /bin/ \;
if [[ -d /etc/bash_completion.d/ ]]; then
find ./bash-completions/ -type f -exec cp {} /etc/bash_completion.d/ \;
fi
if [[ -d /etc/fish/completions/ ]]; then
find ./fish-completions/ -type f -exec cp {} /etc/fish/completions/ \;
fi
}
if [[ $EUID == 0 ]]; then
root_setup
fi
function append_fish_config {
readonly fish_config=~/.config/fish/config.fish
if grep -Fxq 'function export_pentest_variables --on-event fish_prompt' $fish_config; then
exit 0
fi
if [[ -f $fish_config ]]; then
cat << EOF >> $fish_config
function export_pentest_variables --on-event fish_prompt
for s in (grep -E '": [^\{]' ~/.pentest_values.json 2>/dev/null | sed -e 's/: /=/' -e "s/\(\,\)\\\$//" | tr -d \"\ )
export \$s
end
end
EOF
fi
}
case $SHELL in
/usr/bin/fish) append_fish_config ;;
esac
exit 0