home · contact · privacy
Fix home dir setup scripts.
[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 url_firefox="https://ftp.mozilla.org/pub/firefox/releases/66.0/linux-x86_64/en-US/firefox-66.0.tar.bz2"
20 wget "${url_firefox}"
21 mv firefox-66.0.tar.bz2 /opt/
22 cd /opt/
23 tar xf firefox-66.0.tar.bz2
24 rm firefox-66.0.tar.bz2
25 ln -s /opt/firefox/firefox /usr/local/bin/
26 update-alternatives --install /usr/bin/x-www-browser x-www-browser /opt/firefox/firefox 200
27 update-alternatives --set x-www-browser /opt/firefox/firefox
28
29 # Install Firefox plugins.
30 # See <https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Distribution_options/Sideloading_add-ons>
31 extensions_dir="/usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/"
32 mkdir -p "${extensions_dir}"
33 noscript_xpi="noscript-10.6.xpi"
34 url_noscript="https://secure.informaction.com/download/releases/${noscript_xpi}"
35 wget "${url_noscript}"
36 name=$(unzip -p "${noscript_xpi}" manifest.json | jq -r .applications.gecko.id)
37 mv "${noscript_xpi}" "${name}.xpi"
38 tridactyl_xpi="tridactyl-1.14.9pre2457-an+fx.xpi"
39 url_tridactyl="https://tridactyl.cmcaine.co.uk/betas/${tridactyl_xpi}"
40 wget "${url_tridactyl}"
41 name=$(unzip -p "${tridactyl_xpi}" manifest.json | jq -r .applications.gecko.id)
42 mv "${tridactyl_xpi}" "${name}.xpi"
43 mv *.xpi "${extensions_dir}"
44
45 # Set up user environments.
46 cd "${setup_scripts_dir}"
47 ./copy_dirtree.sh "${config_tree_prefix}/home_files" "/root" minimal root
48 HOME_DIR_EXISTS=$([ ! -d "/home/plom" ]; echo $?)
49 if [ ! -d "/home/plom" ]; then
50 adduser --disabled-password --gecos "" plom
51 usermod -a -G sudo plom
52 if [ ! "${HOME_DIR_EXISTS}" -eq 0 ]; then
53     cp setup_home_eeepc.sh /home/plom
54     chown plom:plom /home/plom/setup_home_eeepc.sh
55     su -c "cd && ./setup_home_eeepc.sh" plom
56 fi
57 passwd plom