You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			29 lines
		
	
	
		
			686 B
		
	
	
	
		
			Bash
		
	
			
		
		
	
	
			29 lines
		
	
	
		
			686 B
		
	
	
	
		
			Bash
		
	
#!/bin/bash
 | 
						|
 | 
						|
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
 | 
						|
 | 
						|
function error {
 | 
						|
  echo -e "\\e[91m$1\\e[39m"
 | 
						|
  exit 1
 | 
						|
}
 | 
						|
 | 
						|
#change version to latest each time
 | 
						|
VER="1.0.7"
 | 
						|
 | 
						|
rm -rf ~/usbimager
 | 
						|
mkdir -p ~/usbimager
 | 
						|
cd ~/usbimager
 | 
						|
 | 
						|
echo "Downloading..."
 | 
						|
wget -qO $(pwd)/usbimager.zip https://gitlab.com/bztsrc/usbimager/raw/binaries/usbimager_${VER}-armv7l-linux-x11.zip || error "Failed to download usbimager.zip!"
 | 
						|
 | 
						|
echo "Extracting..."
 | 
						|
unzip $(pwd)/usbimager.zip || error "Failed to extract!"
 | 
						|
rm -f $(pwd)/usbimager.zip
 | 
						|
cd ~/
 | 
						|
 | 
						|
echo "Copying files..."
 | 
						|
sudo cp -av /home/pi/usbimager/* /usr || error "Failed to copy files to /usr!"
 | 
						|
 | 
						|
rm -rf ~/usbimager
 |