/ programs / aarch64 / ventoy
ventoy
 1  #!/bin/sh
 2  
 3  APP=ventoy
 4  SITE="ventoy/Ventoy"
 5  
 6  # CREATE THE FOLDER
 7  mkdir /opt/$APP
 8  cd /opt/$APP
 9  
10  # ADD THE REMOVER
11  echo '#!/bin/sh' >> /opt/$APP/remove
12  echo "rm -R -f /usr/local/share/applications/$APP-AM.desktop /opt/$APP /usr/local/bin/$APP" >> /opt/$APP/remove
13  chmod a+x /opt/$APP/remove
14  
15  # DOWNLOAD THE ARCHIVE
16  mkdir tmp
17  cd ./tmp
18  
19  version=$(curl -Ls https://api.github.com/repos/ventoy/Ventoy/releases | grep browser_download_url | grep -i linux.tar.gz  | cut -d '"' -f 4 | head -1)
20  wget $version
21  echo "$version" >> /opt/$APP/version
22  tar fx ./*; rm -R -f ./*tar*
23  cd ..
24  mv --backup=t ./tmp/ventoy-*/* ./
25  rm -R -f ./tmp
26  
27  # SCRIPT TO LAUNCH THE PROGRAM
28  echo '#!/bin/sh
29  exec /opt/'$APP'/VentoyGUI.aarch64' >> /usr/local/bin/$APP
30  chmod a+x /usr/local/bin/$APP
31  
32  # SCRIPT TO UPDATE THE PROGRAM
33  cat >> /opt/$APP/AM-updater << 'EOF'
34  #!/usr/bin/env bash
35  APP=ventoy
36  version0=$(cat /opt/$APP/version)
37  version=$(curl -Ls https://api.github.com/repos/ventoy/Ventoy/releases | grep browser_download_url | grep -i linux.tar.gz  | cut -d '"' -f 4 | head -1)
38  if [ $version = $version0 ]; then
39  	echo "Update not needed!"
40  else
41  	notify-send "A new version of $APP is available, please wait"
42  	mkdir /opt/$APP/tmp
43  	cd /opt/$APP/tmp
44  	wget $version
45  	tar fx ./*; rm -R -f ./*tar*
46  	cd ..
47  	mv --backup=t ./tmp/ventoy-*/* ./
48  	rm ./version
49  	echo $version >> ./version
50  	rm -R -f ./tmp ./*~
51  	notify-send "$APP is updated!"
52  fi
53  EOF
54  chmod a+x /opt/$APP/AM-updater
55  
56  # ICON
57  mkdir icons
58  wget https://www.ventoy.net/static/img/ventoy.png -O ./icons/$APP 2> /dev/null
59  
60  # LAUNCHER
61  rm -f /usr/local/share/applications/$APP-AM.desktop
62  echo "[Desktop Entry]
63  Name=Ventoy
64  Comment=Open source tool to create bootable USB drive for ISO/WIM/IMG/VHD(x)/EFI files. 
65  Exec=$APP
66  Icon=/opt/$APP/icons/$APP
67  Type=Application
68  Categories=System;" >> /usr/local/share/applications/$APP-AM.desktop