home · contact · privacy
Extend sysadmin mailing tasks.
[config] / jessie_start_server.sh
index 0d12b31a560348052fd1b6a3110ddb7b65d8455f..d3af7fbfe515b4a2f398f71abebe5e2db245d5d6 100755 (executable)
@@ -24,6 +24,7 @@ echo 'APT::Install-Suggests "false";' >> /etc/apt/apt.conf.d/99mindeps
 
 # Set hostname and FQDN.
 echo 'plomlompom' > /etc/hostname
+hostname 'plomlompom'
 echo '127.0.0.1 localhost' > /etc/hosts
 ip=`hostname -I`
 echo "$ip plomlompom.com plomlompom" >> /etc/hosts
@@ -81,17 +82,25 @@ apt-get -y install vim
 mkdir -p .vimbackups
 su plom -c 'mkdir -p /home/plom/.vimbackups/'
 
+# Set up ssh-guard.
+apt-get -y install sshguard rsyslog
+
 # Set up openssh-server.
 apt-get -y install openssh-server
 
 # Set up mail system.
+su plom -c 'mkdir -p /home/plom/mail/'
+su plom -c 'mkdir -p /home/plom/mail/inbox/{cur,new,tmp}'
+su plom -c 'mkdir -p /home/plom/mail/new_inbox/{cur,new,tmp}'
 DEBIAN_FRONTEND=noninteractive apt-get -y install getmail4 procmail mutt postfix maildrop
 cp config/systemfiles/main.cf /etc/postfix/main.cf
 cp config/systemfiles/aliases /etc/aliases
+newaliases
 service postfix restart
-su plom -c 'mkdir -p /home/plom/mail/'
-su plom -c 'mkdir -p /home/plom/mail/inbox/{cur,new,tmp}'
-su plom -c 'mkdir -p /home/plom/mail/new_inbox/{cur,new,tmp}'
+
+# Set up regular system update reminder.
+apt-get -y install cron
+su plom -c "echo '0 0 * * 0 ~/config/bin/simplemail.sh ~/config/mails/update_reminder' | crontab -"
 
 # Set up screen.
 apt-get -y install screen
@@ -107,6 +116,9 @@ systemctl enable /etc/systemd/system/irssi.service
 # Clean up.
 rm jessie_start_server.sh
 
+# Send instructions mail.
+config/bin/simplemail.sh config/mails/server_postinstall_finished
+
 # Set password for user.
 passwd plom