From bc49322f2215db90ed6aa2b572d32df5f9e8790b Mon Sep 17 00:00:00 2001 From: William Date: Mon, 1 Feb 2021 17:29:33 +0100 Subject: [PATCH] Fixes --- install.sh | 25 ++++++++++--------------- wine_serial_fix.sh | 3 ++- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/install.sh b/install.sh index 76e5bd8..75216e9 100644 --- a/install.sh +++ b/install.sh @@ -8,33 +8,28 @@ if [[ $EUID -ne 0 ]]; then exit 1 fi -apt update && apt -y install git wine setserial && -cd /opt/ && -git clone $GIT_REPO && -cd $GIT_NAME && +apt update && apt install -y git wine setserial tlp +systemctl enable tlp --now +cd /opt/ +git clone $GIT_REPO +cd $GIT_NAME - -adduser $USERNAME dialout && +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 && +WantedBy=graphical.target" > "/etc/systemd/system/wine-serial-fix.service" +systemctl daemon-reload +systemctl enable wine-serial-fix.service --now - -su $USERNAME && -wine DLOADX*.exe - +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" \ No newline at end of file diff --git a/wine_serial_fix.sh b/wine_serial_fix.sh index ef00b45..b109af4 100755 --- a/wine_serial_fix.sh +++ b/wine_serial_fix.sh @@ -21,7 +21,8 @@ function doTheThang if [ ! -z "$TTY" ]; then echo -e "\e[1;32mUsing serial device: $TTY\e[0m" - ln -s $TTY /home/$USERNAME/.wine/dosdevices/com1 && + ln -sfn $TTY /home/$USERNAME/.wine/dosdevices/com1 && + chown $USERNAME /home/$USERNAME/.wine/dosdevices/com1 && ls -l /home/$USERNAME/.wine/dosdevices/ | grep $TTY else echo -e "\e[1;31mNo serial device\e[0m"