echo "KeyHelp Components Updater"
sleep 1
echo "By Justman10000"
sleep 2.5

reset

echo "Installing dependencies"
sleep 1.5
bash <(curl -s https://scripts.justman10000.de/install.sh)

reset

echo "Updating RoundCube (Webmail)"
sleep 1.5
cd /home/keyhelp/www/roundcube
mv config/config.inc.php /tmp
rm -r .* *
git init
git pull https://github.com/roundcube/roundcubemail
mv /tmp/config.inc.php config
COMPOSER_ALLOW_SUPERUSER=1 composer install
if command -v bun > /dev/null 2>&1; then
  bun i --no-save
else
  yarn
fi
cd skins/elastic
make css

reset

echo "Updating Dovecot (Mail Delivery Agent (MDA))"
sleep 1.5
mkdir /home/dovecot
cd /home/dovecot
git init
git pull https://github.com/dovecot/core.git
bash autogen.sh
bash configure
make install