-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstolenMagic.sh
executable file
·42 lines (34 loc) · 1.3 KB
/
stolenMagic.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
#!/usr/bin/env bash
allows="$(dirname -- "$0")/.install-profile/allows.sh stolenMagic"
mapfile -t scripts < <(echo "
https://raw.githubusercontent.com/matildeopbravo/dotfiles/master/scripts/f
https://raw.githubusercontent.com/matildeopbravo/dotfiles/master/scripts/vim-anywhere
https://raw.githubusercontent.com/JoseFilipeFerreira/toolbelt/master/toolbox/qrwifi.tool
https://raw.githubusercontent.com/JoseFilipeFerreira/toolbelt/master/toolbox/cuffs.tool
https://raw.githubusercontent.com/JoseFilipeFerreira/toolbelt/master/powertools/thonkbar/scripts/platform_profile
" | xargs --no-run-if-empty -I {} bash -c "$allows \"\$(basename {})\" && echo {}")
user-from-link() {
cut -d/ -f4
}
install-script() {
(
cd ~/.local/bin/ || exit
timeout 5 bash -c "wget --quiet -N '$1' |& grep -v ^SSL_INIT$;"
if [[ "$?" == 124 ]]; then
echo " - timedout fetching $(basename "$1") :("
else
chmod +x "$(basename "$1")"
echo " - $(basename "$1")"
fi
)
}
if [[ "${#scripts[@]}" -eq 0 ]]; then
exit 0
fi
printf "\n\033[33mStealing magic from \033[1m%s\033[0;33m users\033[0m\n" \
"$(printf "%s\n" "${scripts[@]}" | user-from-link | sort -u | wc -l)"
for s in "${scripts[@]}"; do
install-script "$s" &
done
wait
printf "\033[33mDone!\033[0m\n"