X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;ds=sidebyside;f=jessie_start_server.sh;h=a764ef5b6b8ec1cb4608b1737ba67212d3426bfb;hb=b337e1c78a10e4dafa07314e208893e9de69302b;hp=bf56165ffd62f377b8d7424858df08d7416cfc42;hpb=b6d87f0183e52a93a211ef73b25828a9ae1e272c;p=config diff --git a/jessie_start_server.sh b/jessie_start_server.sh index bf56165..a764ef5 100755 --- a/jessie_start_server.sh +++ b/jessie_start_server.sh @@ -5,7 +5,7 @@ set -e # Set root pw. passwd -# Post-installation reduction. (Answer "no" to GRUB question.) +# Post-installation reduction. dpkg-query -Wf '${Package} ${Priority}\n' | grep ' required' | sed 's/ required//' > list_white_unsorted echo 'ifupdown' >> list_white_unsorted echo 'isc-dhcp-client' >> list_white_unsorted @@ -22,6 +22,13 @@ rm list_all_packages list_white_unsorted list_white list_black echo 'APT::Install-Recommends "false";' >> /etc/apt/apt.conf.d/99mindeps 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 + # Call dhclient on startup. cat > /etc/systemd/system/dhclient.service << EOF [Unit] @@ -75,35 +82,46 @@ 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 client system. -apt-get -y install getmail4 procmail mutt -su plom -c 'mkdir -p /home/plom/mail' +# 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}' +sed -i 's/^delete = true$/delete = false/g' /home/plom/config/dotfiles_user_server/getmail/getmailrc +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 + +# Set up regular system update reminder. +apt-get -y install cron +su plom -c "echo '0 18 * * 0 ~/config/bin/simplemail.sh ~/config/mails/update_reminder' | crontab -" # Set up screen. apt-get -y install screen +# Set up ping. +apt-get -y install iputils-ping + # Set up irssi. apt-get -y install irssi +cp config/systemfiles/irssi.service /etc/systemd/system/irssi.service +systemctl enable /etc/systemd/system/irssi.service # Clean up. rm jessie_start_server.sh -cat > /etc/systemd/system/irssi.service << EOF -[Unit] -Description=irssi screen - -[Service] -Type=forking -User=plom -ExecStart=/bin/sh /home/plom/config/other/screen-irssi.sh -[Install] -WantedBy=multi-user.target -EOF -systemctl enable /etc/systemd/system/irssi.service +# Send instructions mail. +config/bin/simplemail.sh config/mails/server_postinstall_finished # Set password for user. passwd plom + +# Finalize everything with a reboot. +reboot