home · contact · privacy
Fix play server setup.
authorChristian Heller <c.heller@plomlompom.de>
Sat, 15 Dec 2018 17:54:03 +0000 (18:54 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sat, 15 Dec 2018 17:54:03 +0000 (18:54 +0100)
all_new_2018/setup_play.sh [changed mode: 0644->0755]
all_new_2018/user_files/encrypter.sh [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index b5e801b..233219d
@@ -8,13 +8,14 @@ if [ $# -lt 1 ]; then
 fi
 gpg_key="$1"
 
+./hardlink_etc.sh play
 config_tree_prefix="${HOME}/config/all_new_2018/"
 apt -y install weechat screen vim
-cp "${config_tree_prefix}user_files/encrypter.sh /home/plom/"
+cp "${config_tree_prefix}user_files/encrypter.sh" /home/plom/
 chown plom:plom /home/plom/encrypter.sh
-cp "${config_tree_prefix}user_files/weechat-wrapper.sh /home/plom/"
+cp "${config_tree_prefix}user_files/weechat-wrapper.sh" /home/plom/
 chown plom:plom /home/plom/weechat-wrapper.sh
-cp "${config_tree_prefix}user_files/weechatrc /home/plom/.weechatrc"
+cp "${config_tree_prefix}user_files/weechatrc" /home/plom/.weechatrc
 chown plom:plom /home/plom/.weechatrc
 apt -y install screen gnupg dirmngr
 keyservers='sks-keyservers.net/ keys.gnupg.net'
@@ -37,4 +38,5 @@ set -e
 echo "$gpg_key" > /home/plom/.encrypt_target
 chown plom:plom /home/plom/.encrypt_target
 # TODO: We may remove dirmngr here if only this script installed it.
-service encrypt_chatlogs.timer start
+systemctl daemon-reload
+systemctl start encrypt_chatlogs.timer
old mode 100644 (file)
new mode 100755 (executable)
index 6a35954..e2ebd44
@@ -1,4 +1,9 @@
 #!/bin/sh
+# Encrypt dated weechatlog files older than one day to GPG target defined in
+# ~/.encrypt_target
 set -e
 
 gpg_key=$(cat ~/.encrypt_target)
+cd ~/weechatlogs/irc/
+find . -regextype posix-egrep -regex '^.*/.*/.*\.[0-9]{4}-[0-9]{2}-[0-9]{2}\.weechatlog$' -type f -mtime +1 -exec gpg --recipient "${gpg_key}" --trust-model always --encrypt {} \; -exec rm {} \;
+