kvs-linuxmint-dloadx/install.sh

35 lines
894 B
Bash
Raw Normal View History

2021-01-31 11:41:38 +00:00
#!/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
2021-02-01 16:29:33 +00:00
apt update && apt install -y git wine setserial tlp
systemctl enable tlp --now
cd /opt/
git clone $GIT_REPO
cd $GIT_NAME
2021-01-31 11:41:38 +00:00
2021-02-01 16:29:33 +00:00
adduser $USERNAME dialout
2021-01-31 11:41:38 +00:00
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]
2021-02-01 16:29:33 +00:00
WantedBy=graphical.target" > "/etc/systemd/system/wine-serial-fix.service"
systemctl daemon-reload
systemctl enable wine-serial-fix.service --now
2021-01-31 11:41:38 +00:00
2021-02-01 16:29:33 +00:00
sudo -H -u $USERNAME bash -c "cd /opt/$GIT_NAME && wine DLOADX*.exe"
2021-01-31 11:41:38 +00:00
echo -e "\e[1;32mFerdig. Logg ut og inn av økten eller start datamaskinen på nytt.\e[0m"