forked from omgmog/install-all-firefox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·46 lines (37 loc) · 1.42 KB
/
bootstrap.sh
File metadata and controls
executable file
·46 lines (37 loc) · 1.42 KB
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
#!/bin/bash
readonly PROGNAME=$(basename $0)
main () {
local remote_dir="https://raw.githubusercontent.com/omgmog/install-all-firefox/master/"
local script_name="firefoxes.sh"
local temp_dir="/tmp/"
local remote_script="${remote_dir}${script_name}"
local local_script="${temp_dir}${script_name}"
local choice_made=0
local current_dir="${PWD}/"
echo -e "You should be using ${script_name} not ${PROGNAME}."
echo -e "I'll download the new script for you now."
if curl -L "${remote_script}" -o "${local_script}"; then
echo -e "Successfully downloaded ${script_name} to ${local_script}"
chmod +x "${local_script}"
echo -e "Do you want to copy ${local_script} to your current directory?"
read user_choice
while [[ "${choice_made}" < 1 ]]; do
case "$(echo ${user_choice} | tr '[:upper:]' '[:lower:]')" in
"y" | "yes")
choice_made=1
echo -e "Copying ${script_name} to ${current_dir}"
cp "${local_script}" "${current_dir}${script_name}"
;;
"n" | "no")
choice_made=1
echo -e "Okay, I'll leave it in ${local_script}"
;;
*)
echo -e "Please enter 'y' or 'n'."
read user_choice
;;
esac
done
fi
}
main "$@"