63 lines
2.1 KiB
Bash
Executable file
63 lines
2.1 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
umask 022
|
|
|
|
# Create /opt directories.
|
|
mkdir -p -m 755 {/opt,/opt/{bin,include,info,lib64,man,man/man{0..8},sbin,share}}
|
|
|
|
# Install the LetsEncrypt CA bundles, to stop wget moaning.
|
|
cp -R ca-certificates /usr/local/share
|
|
update-ca-certificates
|
|
|
|
# Install memtest86 into /boot.
|
|
# Only install if /boot exists, so we are container compatible.
|
|
[ -e /boot ] && cp memtest86+ /boot
|
|
|
|
# Install root's new crontab.
|
|
cat root.crontab >/var/spool/cron/crontabs/root
|
|
/etc/rc.d/rc.crond restart
|
|
|
|
# Install the /etc files.
|
|
( cd base-files
|
|
IFS=$'\n'
|
|
for dir in $(find . -type d | sort | sed -re 's/^\.\///'); do
|
|
mkdir -p -m 755 /etc/$dir
|
|
done
|
|
for file in $(find . -type f | sort | sed -re 's/^\.\///'); do
|
|
cat "$file" >"/etc/$file"
|
|
done )
|
|
|
|
# Correct file/directory specific permissions.
|
|
chmod 755 /etc/cron.daily/update-slackpkg-template
|
|
chmod 755 /etc/cron.daily/warn-git-status
|
|
chmod 755 /etc/cron.hourly/log-acls
|
|
chmod 755 /etc/initscript
|
|
chmod 755 /etc/profile.d/biff.csh
|
|
chmod 755 /etc/profile.d/biff.sh
|
|
chmod 755 /etc/profile.d/lang.csh
|
|
chmod 755 /etc/profile.d/lang.sh
|
|
chmod 755 /etc/profile.d/less.csh
|
|
chmod 755 /etc/profile.d/less.sh
|
|
chmod 755 /etc/profile.d/optpaths.csh
|
|
chmod 755 /etc/profile.d/optpaths.sh
|
|
chmod 750 /etc/sudoers.d
|
|
|
|
# Install pushover.
|
|
cp utils/pushover /opt/bin
|
|
chmod 755 /opt/bin/pushover
|
|
|
|
# Decrypt the pushover-config.
|
|
echo "Decrypting /etc/pushover/*.gpg..."
|
|
read -r -p "Passphraise (appears in clear text): " PASS
|
|
gpg -d --passphrase "$PASS" -o /etc/pushover/backups /etc/pushover/backups.gpg
|
|
gpg -d --passphrase "$PASS" -o /etc/pushover/mirroring /etc/pushover/mirroring.gpg
|
|
gpg -d --passphrase "$PASS" -o /etc/pushover/server /etc/pushover/server.gpg
|
|
chmod 640 /etc/pushover/*
|
|
|
|
# Decrypt the netdata SSL key.
|
|
echo "Decrypting netdata SSL key..."
|
|
gpg -d --passphrase "$PASS" -o /etc/certificates/_netdata_.opensourcerers.net-key.pem /etc/certificates/_netdata_.opensourcerers.net-key.pem.gpg
|
|
chmod 640 /etc/certificates/_netdata_.opensourcerers.net-key.pem
|
|
chown root:36 /etc/certificates/_netdata_.opensourcerers.net-key.pem
|
|
rm -f /etc/certificates/_netdata_.opensourcerers.net-key.pem.gpg
|
|
unset PASS
|