#!/bin/bash GIT_REPO="https://git.willy.club/William/kvs-linuxmint-dloadx" GIT_NAME="kvs-linuxmint-dloadx" # Must not contain spaces and/or weird characters USERNAME=$(logname) if [[ $EUID -ne 0 ]]; then echo "This script must be run as root." exit 1 fi apt update && apt install -y git wine setserial tlp systemctl enable tlp --now cd /opt/ rm -r $GIT_NAME git clone $GIT_REPO cd $GIT_NAME adduser $USERNAME dialout echo "[Unit] Description=Wine Serial Fix After=network.target [Service] Type=simple ExecStart=bash /opt/$GIT_NAME/wine_serial_fix.sh $USERNAME TimeoutStartSec=0 [Install] WantedBy=graphical.target" > "/etc/systemd/system/wine-serial-fix.service" systemctl daemon-reload systemctl enable wine-serial-fix.service --now sudo -H -u $USERNAME bash -c "cd /opt/$GIT_NAME && wine DLOADX*.exe" echo -e "\e[1;32mFerdig. Logg ut og inn av økten eller start datamaskinen på nytt.\e[0m"