home · contact · privacy
Upgrade Raspi setup.
[config] / all_new_2018 / setup_scripts / setup_play.sh
1 #!/bin/sh
2 set -e
3
4 # Ensure we have a GPG target to encrypt to.
5 if [ $# -lt 1 ]; then
6     echo "Need public key ID as argument."
7     false
8 fi
9 gpg_key="$1"
10
11 config_tree_prefix="${HOME}/config/all_new_2018"
12 setup_scripts_dir="${config_tree_prefix}/setup_scripts"
13 cd "${setup_scripts_dir}"
14
15 # If anything strange happens, let root send mail to us.
16 ./setup_sendonly.sh
17
18 # Apart from weechat, vim and screen will also be useful for everyday activity.
19 apt -y install weechat screen vim
20
21 # Link and copy over files.
22 ./hardlink_etc.sh play
23 cp "${config_tree_prefix}/user_files/encrypter.sh" /home/plom/
24 chown plom:plom /home/plom/encrypter.sh
25 cp "${config_tree_prefix}/user_files/weechat-wrapper.sh" /home/plom/
26 chown plom:plom /home/plom/weechat-wrapper.sh
27 cp "${config_tree_prefix}/user_files/weechatrc" /home/plom/.weechatrc
28 chown plom:plom /home/plom/.weechatrc
29 apt -y install screen
30 echo "$gpg_key" > /home/plom/.encrypt_target
31 chown plom:plom /home/plom/.encrypt_target
32
33 # Start encrypt_chatlogs job.
34 ./add_encryption_key.sh "${gpg_key}"
35 systemctl daemon-reload
36 systemctl start encrypt_chatlogs.timer