This commit is contained in:
William 2021-02-01 17:29:33 +01:00
parent 4d74ec3a49
commit bc49322f22
2 changed files with 12 additions and 16 deletions

View File

@ -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"

View File

@ -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"