forked from Wilaak/kvs-linuxmint-dloadx
		
	
		
			
				
	
	
		
			45 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Bash
		
	
	
	
	
	
			
		
		
	
	
			45 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Bash
		
	
	
	
	
	
| #!/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
 | |
| TARGET_DIR="/opt" #directory to install to
 | |
| USERNAME=$(logname)
 | |
| 
 | |
| echo "What directory do you want to install to?"
 | |
| echo "Specify directory below and files wil be copied in to a subdirectory of that directory called /$GIT_NAME"
 | |
| echo "Default is /opt"
 | |
| read TARGET_DIR
 | |
| 
 | |
| if [ $TARGET_DIR == "" ]; then
 | |
|     TARGET_DIR="/opt"
 | |
| fi
 | |
| 
 | |
| if [[ $EUID -ne 0 ]]; then #make shure that script is being run as root
 | |
|     echo "This script must be run as root." 
 | |
|     exit 1
 | |
| fi
 | |
| 
 | |
| apt update && apt install -y git wine setserial tlp #install dependencies
 | |
| systemctl enable tlp --now #enable and start nessecary systemd service file
 | |
| cd $TARGET_DIR/ #change current working directory to install directory
 | |
| git clone $GIT_REPO #clone git again
 | |
| cd $GIT_NAME #enter directory of cloned git
 | |
| 
 | |
| 
 | |
| adduser $USERNAME dialout # ????
 | |
| echo "[Unit]
 | |
| Description=Wine Serial Fix
 | |
| After=network.target
 | |
| [Service]
 | |
| Type=simple
 | |
| ExecStart=bash $TARGET_DIR/$GIT_NAME/wine_serial_fix.sh $USERNAME
 | |
| TimeoutStartSec=0
 | |
| [Install]
 | |
| WantedBy=graphical.target" > "/etc/systemd/system/wine-serial-fix.service" #creates systemd service file
 | |
| systemctl daemon-reload #make systemd detect the new service file
 | |
| systemctl enable wine-serial-fix.service --now #enables and starts the systemd service file
 | |
| 
 | |
| 
 | |
| 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" #done |