Compare commits

..

6 Commits

Author SHA1 Message Date
3d9022dcc5 changes 2021-02-04 13:55:07 +01:00
3025579b98 added more documentation 2021-02-03 20:12:32 +01:00
ee2e8acdce added more documentation 2021-02-03 20:11:29 +01:00
be7862b457 you can now choose install directrory 2021-02-03 20:09:24 +01:00
69166faf30 added more documentation 2021-02-03 20:01:41 +01:00
7fe978e8a9 added documentation and some minor changes 2021-02-03 19:51:20 +01:00
3 changed files with 22 additions and 18 deletions

View File

@@ -1,6 +1,10 @@
# Installere DLOADX programvare på Linux Mint 20.1 # Installere DLOADX programvare på Linux Mint 20.1
Etter du er ferdig med installasjonen av Linux Mint 20.1. Logg inn med brukeren du konfigurerte under installasjonen, deretter åpne terminalen og utfør følgende kommando. Etter du er ferdig med installasjonen av Linux Mint 20.1. Logg inn med bruken du konfigurerte under installasjonen, deretter åpne terminalen og utfør følgende kommando.
sudo apt update && sudo apt install -y curl
Deretter utfør følgende kommando og følg gjennom installasjonen.
curl -sSL https://git.willy.club/William/kvs-linuxmint-dloadx/raw/branch/master/install.sh | sudo bash curl -sSL https://git.willy.club/William/kvs-linuxmint-dloadx/raw/branch/master/install.sh | sudo bash

View File

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

View File

@@ -19,7 +19,7 @@ function doTheThang
# TTY is empty if no serial device is detected # TTY is empty if no serial device is detected
TTY=$(setserial -g /dev/ttyUSB[0-9] | awk -F"," '{print $1}') TTY=$(setserial -g /dev/ttyUSB[0-9] | awk -F"," '{print $1}')
if [ ! -z "$TTY" ]; then if [ ! -z "$TTY" ]; then #configure wine to use serial device
echo -e "\e[1;32mUsing serial device: $TTY\e[0m" echo -e "\e[1;32mUsing serial device: $TTY\e[0m"
ln -sfn $TTY /home/$USERNAME/.wine/dosdevices/com1 && ln -sfn $TTY /home/$USERNAME/.wine/dosdevices/com1 &&
chown $USERNAME /home/$USERNAME/.wine/dosdevices/com1 && chown $USERNAME /home/$USERNAME/.wine/dosdevices/com1 &&
@@ -32,11 +32,11 @@ doTheThang
LSUSB=$(lsusb) LSUSB=$(lsusb)
while : while :
do do #look for usb
if [ "$LSUSB" != "$(lsusb)" ]; then if [ "$LSUSB" != "$(lsusb)" ]; then
LSUSB=$(lsusb) LSUSB=$(lsusb)
echo "=======USB Change detected=======" echo "=======USB Change detected======="
doTheThang doTheThang #usb found, run function
fi fi
sleep 1 sleep 1
done done