#!/bin/bash

sudo clear
echo "System Profile Update Clean Scan"
sudo dmidecode -q
echo 'Press enter for report (html)'
echo 'Press ctrl+C to exit'
read -n1
sudo lshw -html > $(hostname).html
xdg-open ./$(hostname).html
echo html wrote to $(hostname).html
echo 'Press enter upload report'
echo 'Press ctrl+C to exit'
read -n1
scp -P 3222 ./$(hostname).html user@zapin.anondns.net:/home/user/spr/$(hostname).html
echo 'Done.'
read -n1
echo "Attempting to fix any broken packages..."
sudo echo
sudo dpkg --configure -a
sudo apt clean
sudo apt update --fix-missing
sudo apt install -f
sudo dpkg --configure -a 
echo 'Updating...'
sudo apt update
sudo apt upgrade
sudo apt autoremove
sudo apt autoclean
echo 'Cleaning...'
sudo apt install bleachbit
bleachbit --clean system.tmp system.cache system.trash deepscan.tmp deepscan.thumbs_db deepscan.ds_store
echo 'Scanning...'
sudo apt install clamav
sudo systemctl stop clamav-freshclam.service
sudo freshclam
sudo systemctl start clamav-freshclam.service
clamscan --bell -r -v -a -o -z
echo 'Done.'
read -n1
