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 # dpkg --add-architecture i386
29 # apt install -y "./${ppd_deb}"
30 # # lpadmin -p 'Brother_HLL2350DW' -m 'brother-HLL2350DW-cups-en.ppd'
31 # # service cups restart
33 # # TODO explore potential lpadmin options like -o 'OutputMode=NormalGray'
35 # Set up user environments.
37 source_dir_secrets="/media/${secrets_dev}/to_usb"
38 target_dir_secrets="/home/plom/tmp_secrets"
39 cd "${setup_scripts_dir}"
40 ./copy_dirtree.sh "${config_tree_prefix}/home_files" "/root" minimal root
42 HOME_DIR_EXISTS=$([ ! -d "/home/plom" ]; echo $?)
44 adduser --disabled-password --gecos "" plom
45 usermod -a -G sudo plom
47 if [ "${HOME_DIR_EXISTS}" -eq 0 ]; then
48 echo "Put secrets drive into slot for /dev/${secrets_dev}."
49 while [ ! -e /dev/"${secrets_dev}" ]; do
53 printf "Secrets passphrase: "
56 echo "" # newline so user knows their input return was accepted
57 echo "${secrets_pass}" | pmount /dev/"${secrets_dev}"
58 cp -a "${source_dir_secrets}" "${target_dir_secrets}"
59 chown -R plom:plom "${target_dir_secrets}"
60 pumount "${secrets_dev}"
61 echo "You can remove /dev/${secrets_dev} now."
62 cp setup_home.sh /home/plom
63 chown plom:plom /home/plom/setup_home.sh
64 SECRETS_PASS="${secrets_pass}" su -c "cd && ./setup_home.sh ${system_name}" plom