home · contact · privacy
Update Firefox stuff.
[config] / buster / setup_scripts / setup_eeepc.sh
1 #!/bin/sh
2 set -e
3
4 if [ "$#" -ne 1 ]; then
5     echo 'Need exactly one argument (hostname).'
6     false
7 fi
8 hostname="$1"
9
10 # Set up system without user environment.
11 config_tree_prefix="${HOME}/config/buster"
12 setup_scripts_dir="${config_tree_prefix}/setup_scripts"
13 cd "${setup_scripts_dir}"
14 ./setup.sh "${hostname}" ""
15 ./copy_dirtree.sh "${config_tree_prefix}/etc_files" "" eeepc
16 ./install_for_target.sh eeepc
17
18 # Install Firefox directly from Mozilla.
19 firefox_release="68.0esr"
20 firefox_filename="firefox-${firefox_release}.tar.bz2"
21 url_firefox="https://ftp.mozilla.org/pub/firefox/releases/${firefox_release}/linux-x86_64/en-US/${firefox_filename}"
22 wget "${url_firefox}"
23 mv "${firefox_filename}" /opt/
24 cd /opt/
25 tar xf "${firefox_filename}"
26 rm "${firefox_filename}"
27 ln -s /opt/firefox/firefox /usr/local/bin/
28 update-alternatives --install /usr/bin/x-www-browser x-www-browser /opt/firefox/firefox 200
29 update-alternatives --set x-www-browser /opt/firefox/firefox
30
31 # Install Firefox plugins.
32 # See <https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Distribution_options/Sideloading_add-ons>
33 extensions_dir="/usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/"
34 mkdir -p "${extensions_dir}"
35 noscript_xpi="noscript-11.0.2.xpi"
36 url_noscript="https://secure.informaction.com/download/releases/${noscript_xpi}"
37 wget "${url_noscript}"
38 name=$(unzip -p "${noscript_xpi}" manifest.json | jq -r .applications.gecko.id)
39 mv "${noscript_xpi}" "${name}.xpi"
40 tridactyl_xpi="tridactyl-latest.xpi"
41 url_tridactyl="https://tridactyl.cmcaine.co.uk/betas/${tridactyl_xpi}"
42 wget "${url_tridactyl}"
43 name=$(unzip -p "${tridactyl_xpi}" manifest.json | jq -r .applications.gecko.id)
44 mv "${tridactyl_xpi}" "${name}.xpi"
45 mv *.xpi "${extensions_dir}"
46
47 # Set up user environments.
48 secrets_dev="sdb"
49 source_dir_secrets="/media/${secrets_dev}/to_usb"
50 target_dir_secrets="/home/plom/tmp_secrets"
51 cd "${setup_scripts_dir}"
52 ./copy_dirtree.sh "${config_tree_prefix}/home_files" "/root" minimal root
53 HOME_DIR_EXISTS=$([ ! -d "/home/plom" ]; echo $?)
54 adduser --disabled-password --gecos "" plom
55 usermod -a -G sudo plom
56 passwd plom
57 if [ "${HOME_DIR_EXISTS}" -eq 0 ]; then
58     echo "Put secrets drive into slot for /dev/${secrets_dev}."
59     while [ ! -e /dev/"${secrets_dev}" ]; do
60         sleep 1
61     done
62     stty -echo
63     printf "Secrets passphrase: "
64     read secrets_pass
65     stty echo
66     echo "" # newline so user knows their input return was accepted
67     echo "${secrets_pass}" | pmount /dev/"${secrets_dev}"
68     cp -a "${source_dir_secrets}" "${target_dir_secrets}"
69     chown -R plom:plom "${target_dir_secrets}"
70     pumount "${secrets_dev}"
71     echo "You can remove /dev/${secrets_dev} now."
72     cp setup_home_eeepc.sh /home/plom
73     chown plom:plom /home/plom/setup_home_eeepc.sh
74     SECRETS_PASS="${secrets_pass}" su -c "cd && ./setup_home_eeepc.sh" plom
75 fi