51 lines
2.7 KiB
Bash
51 lines
2.7 KiB
Bash
# Require APT to utilizelocal proxy
|
|
echo "Acquire::http::proxy \"http://192.168.128.185:3142\";" >> /etc/apt/apt.conf.d/02proxy
|
|
|
|
# Set TimeZone :)
|
|
timedatectl set-timezone America/Chicago
|
|
|
|
# Perform update / upgrade of all existing packages and repos
|
|
apt update && apt upgrade -y
|
|
|
|
# Install curl and git if not present
|
|
apt install curl git ca-certificates fonts-liberation libasound2 libatk-bridge2.0-0 libatk1.0-0 \
|
|
libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 \
|
|
libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 \
|
|
libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 \
|
|
libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils \
|
|
apache2 php php-curl php-json php-cgi libapache2-mod-php -y
|
|
|
|
# Add NodeSource repository (replace 22.x with your desired version, e.g., 20.x, 18.x)
|
|
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
|
|
|
|
# Install Node.js
|
|
apt install -y nodejs
|
|
|
|
# Git clone the actual-helpers repo
|
|
cd /opt
|
|
git clone https://git.kollman.net/rlkollman/actual-helpers
|
|
|
|
# Install all dependencies
|
|
cd /opt/actual-helpers
|
|
npm install
|
|
|
|
# Write crontab file with scheduled tasks
|
|
echo "" >> /etc/crontab
|
|
echo "# Sync ActualBudget Bank Accounts daily at 2 AM" >> /etc/crontab
|
|
echo "00 2 * * * root cd /opt/actual-helpers && node sync-banks.js > /dev/null" >> /etc/crontab
|
|
echo "05 2 * * * root cd /opt/actual-helpers && node update-investments.js > /dev/null" >> /etc/crontab
|
|
echo "" >> /etc/crontab
|
|
echo "# Sync ActualBudget Vehicles & Apply Mortgage Interest on the 1st day of every month at 3 AM" >> /etc/crontab
|
|
echo "00 3 1 * * root cd /opt/actual-helpers && node kbb.js > /dev/null" >> /etc/crontab
|
|
echo "15 3 6 * * root cd /opt/actual-helpers && node apply-interest.js > /dev/null" >> /etc/crontab
|
|
echo "" >> /etc/crontab
|
|
echo "# Sync ActualBudget Residence through RentCast on the 1st & 15th day of every month at 4 AM" >> /etc/crontab
|
|
echo "#00 4 1 * * root cd /opt/actual-helpers && node rentcast.js > /dev/null" >> /etc/crontab
|
|
echo "#00 4 15 * * root cd /opt/actual-helpers && node rentcast.js > /dev/null" >> /etc/crontab
|
|
echo "" >> /etc/crontab
|
|
echo "# Sync ActualBudget Residence through Zillow on the 1st & 16th day of every month at 5 AM" >> /etc/crontab
|
|
echo "30 4 1 * * root cd /opt/actual-helpers && node zestimate.js > /dev/null" >> /etc/crontab
|
|
echo "30 4 16 * * root cd /opt/actual-helpers && node zestimate.js > /dev/null" >> /etc/crontab
|
|
echo "" >> /etc/crontab
|
|
echo "# Output the current budget status to a file" >> /etc/crontab
|
|
echo "00 5 * * * root cd /opt/actual-helpers && node budget.js > /root/budget.txt" >> /etc/crontab |