Files
reseed-tools/postinstall-pak

50 lines
1.7 KiB
Plaintext
Raw Permalink Normal View History

2021-12-03 23:56:32 -05:00
#! /usr/bin/env sh
RESEED_MESSAGE="Reseed Tools requires you to set an email for contact purposes.
This is in case your reseed goes down.
Please enter your email below."
RESEED_CONF="# Use this file to configure the contact/signer email used for the reseed service.
# without it the reseed will fail to start.
[Service]
Environment=\"RESEED_EMAIL="
RESEED_DEFAULT="#Edit the contact/signing email used by your reseed server here
export RESEED_EMAIL=\""
2023-01-04 03:37:32 +00:00
mkdir -p /etc/systemd/system/reseed.service.d/
2021-12-03 23:56:32 -05:00
INIT=$(file /sbin/init 2>&1 | grep systemd)
if [ ! -z "$INIT" ]; then
rm -f /etc/default/reseed /etc/init.d/reseed
2021-12-03 23:56:32 -05:00
fi
if [ -t 1 ] ; then
if [ -f /usr/bin/whiptail ]; then
RESEED_EMAIL=$(whiptail --inputbox "$RESEED_MESSAGE" 10 30 3>&1 1>&2 2>&3)
if [ ! -z "$INIT" ]; then
2023-01-04 03:37:32 +00:00
echo "$RESEED_CONF$RESEED_EMAIL\"" | tee /etc/systemd/system/reseed.service.d/override.conf
2023-01-04 03:18:13 +00:00
systemctl enable reseed.service
systemctl daemon-reload
else
echo "$RESEED_DEFAULT$RESEED_EMAIL\"" | tee /etc/default/reseed
fi
exit 0
fi
2021-12-03 23:56:32 -05:00
else
if [ -f /usr/bin/zenity ]; then
RESEED_EMAIL=$(zenity --entry --title "Reseed Configuration" --text "$RESEED_MESSAGE" 10 30 3>&1 1>&2 2>&3)
if [ ! -z "$INIT" ]; then
2023-01-04 03:37:32 +00:00
echo "$RESEED_CONF$RESEED_EMAIL\"" | tee /etc/systemd/system/reseed.service.d/override.conf
#systemctl enable /etc/systemd/system/reseed.service.d/reseed.service
2023-01-04 03:18:13 +00:00
systemctl enable reseed.service
systemctl daemon-reload
else
echo "$RESEED_DEFAULT$RESEED_EMAIL\"" | tee /etc/default/reseed
fi
exit 0
fi
2021-12-03 23:56:32 -05:00
fi