home · contact · privacy
Move secrets setup into home setup script.
authorChristian Heller <c.heller@plomlompom.de>
Mon, 6 May 2019 21:10:48 +0000 (23:10 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 6 May 2019 21:10:48 +0000 (23:10 +0200)
buster/setup_scripts/setup_home_eeepc.sh
buster/setup_scripts/setup_secrets.sh

index 90db564c302c575eebcfff6e686f366e825d8b16..be52afbc2656d4a268d5cb77182941acbb2e0f5e 100755 (executable)
@@ -5,6 +5,11 @@ public_repos_dir="${HOME}/public_repos"
 config_tree_prefix="${public_repos_dir}/config/buster"
 setup_scripts_dir="${config_tree_prefix}/setup_scripts"
 repos_list_file="${public_repos_dir}/repos"
+secrets_dev="sdb"
+source_dir="/media/${secrets_dev}/to_usb"
+target_dir="${HOME}/tmp_to_usb"
+borgkeys_dir=~/.config/borg/keys
+ssh_dir=~/.ssh
 
 ensure_repo() {
     repo_name="${1}"
@@ -17,14 +22,28 @@ ensure_repo() {
 cd
 mkdir -p "${public_repos_dir}"
 ensure_repo config
-#if [ ! -d "${HOME}/${public_repos_dir}/config" ]; then
-#    cd "${public_repos_dir}"
-#    git clone https://plomlompom.com/repos/clone/config
-#fi
 cd "${setup_scripts_dir}"
 ./copy_dirtree.sh "${config_tree_prefix}/home_files" "${HOME}" minimal user_eeepc
 cat "${repos_list_file}" | while read line; do
     ensure_repo "${line}"
 done
 curl -fsSl https://raw.githubusercontent.com/tridactyl/tridactyl/78e662efefd1f4af2bdb2a53edecf03b535b997b/native/install.sh | bash
-echo "As tridactyl user, don't forget to do :source on the first Firefox run and then re-start."
+while [ ! -e /dev/"${secrets_dev}" ]; do
+    echo "Put secrets drive into slot for /dev/${secrets_dev}, then hit Return."
+    read ignore
+done
+sudo pmount /dev/"${secrets_dev}"
+cp -a "${source_dir}" "${target_dir}"
+sudo pumount "${secrets_dev}"
+echo "You can remove /dev/${secrets_dev} now."
+cd "${target_dir}"
+mkdir -p "${ssh_dir}"
+echo "Setting up .ssh"
+cp id_rsa ~/.ssh
+ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub
+tar xf borg_keyfiles.tar
+mkdir -p "${borgkeys_dir}"
+mv borg_keyfiles/* "${borgkeys_dir}"
+cd
+rm -rf "${target_dir}"
+echo "TODO: As tridactyl user, don't forget to do :source on the first Firefox run and then re-start."
index 25a49bbc47dce3ffa24380f63272f33dd17810fd..3308232b337bba135488c18acafcf57e17c52acf 100755 (executable)
@@ -1,21 +1,22 @@
 #!/bin/sh
 set -e
 
-dev="sdb"
-source_dir="/media/${dev}/to_usb"
+secrets_dev="sdb"
+source_dir="/media/${secrets_dev}/to_usb"
 target_dir="${HOME}/tmp_to_usb"
 borgkeys_dir=~/.config/borg/keys
 ssh_dir=~/.ssh
-while [ ! -e /dev/"${dev}" ]; do
-    echo "Put secrets drive into slot for /dev/${dev}, then hit Return."
-    read
+while [ ! -e /dev/"${secrets_dev}" ]; do
+    echo "Put secrets drive into slot for /dev/${secrets_dev}, then hit Return."
+    read ignore
 done
-sudo pmount /dev/"${dev}"
+sudo pmount /dev/"${secrets_dev}"
 cp -a "${source_dir}" "${target_dir}"
-sudo pumount "${dev}"
-echo "You can remove /dev/${dev} now."
+sudo pumount "${secrets_dev}"
+echo "You can remove /dev/${secrets_dev} now."
 cd "${target_dir}"
 mkdir -p "${ssh_dir}"
+echo "Setting up .ssh"
 cp id_rsa ~/.ssh
 ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub
 tar xf borg_keyfiles.tar