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 # lpadmin -p 'HP_Deskjet_F300_series' -m 'drv:///hpcups.drv/hp-deskjet_f300_series.ppd' -o 'OutputMode=NormalGray' -E
26 # service cups restart
28 # Set up user environments.
30 source_dir_secrets="/media/${secrets_dev}/to_usb"
31 target_dir_secrets="/home/plom/tmp_secrets"
32 cd "${setup_scripts_dir}"
33 ./copy_dirtree.sh "${config_tree_prefix}/home_files" "/root" minimal root
35 HOME_DIR_EXISTS=$([ ! -d "/home/plom" ]; echo $?)
37 adduser --disabled-password --gecos "" plom
38 usermod -a -G sudo plom
40 if [ "${HOME_DIR_EXISTS}" -eq 0 ]; then
41 echo "Put secrets drive into slot for /dev/${secrets_dev}."
42 while [ ! -e /dev/"${secrets_dev}" ]; do
46 printf "Secrets passphrase: "
49 echo "" # newline so user knows their input return was accepted
50 echo "${secrets_pass}" | pmount /dev/"${secrets_dev}"
51 cp -a "${source_dir_secrets}" "${target_dir_secrets}"
52 chown -R plom:plom "${target_dir_secrets}"
53 pumount "${secrets_dev}"
54 echo "You can remove /dev/${secrets_dev} now."
55 cp setup_home.sh /home/plom
56 chown plom:plom /home/plom/setup_home.sh
57 SECRETS_PASS="${secrets_pass}" su -c "cd && ./setup_home.sh ${system_name}" plom