4 if [ "$#" -ne 1 ]; then
5 echo 'Need exactly one argument (system name).'
8 if [ ! "$1" = "x220" ] && [ ! "$1" = "w530" ]; then
9 echo "Need legal system name."
14 # Set up system without user environment.
15 config_tree_prefix="${HOME}/config/bullseye"
16 setup_scripts_dir="${config_tree_prefix}/setup_scripts"
17 cd "${setup_scripts_dir}"
18 if [ "$1" = "x200s" ] || [ "$1" = "x220" ] || [ "$1" = "w530" ]; then
19 ./setup.sh "${system_name}" "" user desktop thinkpad "${system_name}"
21 ./setup.sh "${system_name}" "" user desktop "${system_name}"
25 ppd_deb="hll2350dwpdrv-4.0.0-1.i386.deb"
26 wget "https://download.brother.com/welcome/dlf103566/${ppd_deb}"
27 apt install -y "./{ppd_deb}"
28 lpadmin -p 'Brother HLL2350DW' -m 'brother-HLL2350DW-cups-en.ppd'
31 # TODO explore potential lpadmin options like -o 'OutputMode=NormalGray'
33 # Set up user environments.
35 source_dir_secrets="/media/${secrets_dev}/to_usb"
36 target_dir_secrets="/home/plom/tmp_secrets"
37 cd "${setup_scripts_dir}"
38 ./copy_dirtree.sh "${config_tree_prefix}/home_files" "/root" minimal root
40 HOME_DIR_EXISTS=$([ ! -d "/home/plom" ]; echo $?)
42 adduser --disabled-password --gecos "" plom
43 usermod -a -G sudo plom
45 if [ "${HOME_DIR_EXISTS}" -eq 0 ]; then
46 echo "Put secrets drive into slot for /dev/${secrets_dev}."
47 while [ ! -e /dev/"${secrets_dev}" ]; do
51 printf "Secrets passphrase: "
54 echo "" # newline so user knows their input return was accepted
55 echo "${secrets_pass}" | pmount /dev/"${secrets_dev}"
56 cp -a "${source_dir_secrets}" "${target_dir_secrets}"
57 chown -R plom:plom "${target_dir_secrets}"
58 pumount "${secrets_dev}"
59 echo "You can remove /dev/${secrets_dev} now."
60 cp setup_home.sh /home/plom
61 chown plom:plom /home/plom/setup_home.sh
62 SECRETS_PASS="${secrets_pass}" su -c "cd && ./setup_home.sh ${system_name}" plom