Skip to content

Instantly share code, notes, and snippets.

@yucellmustafa
Last active January 26, 2024 12:50
Show Gist options
  • Save yucellmustafa/c79ef02f74c3e9c93af2f9759c8d8550 to your computer and use it in GitHub Desktop.
Save yucellmustafa/c79ef02f74c3e9c93af2f9759c8d8550 to your computer and use it in GitHub Desktop.
Ventoy Installer for Linux
repo=github.com/repos/ventoy/Ventoy
link=$(curl -s https://api.$repo/releases/latest | jq -r ".assets[] | select(.name | test(\"linux\")) | .browser_download_url")
version=$(curl -s https://api.$repo/releases/latest | jq -r ".tag_name")
file=ventoy-$version
arch=$(uname -m)
download() {
if [ ! -f $file.tar.gz ]; then
echo "Downloading $file.tar.gz..."
curl -L $link -o $file.tar.gz
fi
}
install() {
download
echo "Installing $file..."
tar -xzf $file.tar.gz
rm -rf $file.tar.gz
sudo mv ./ventoy-* /opt/$file
echo "#!/bin/bash
/opt/$file/VentoyGUI.$arch" | sudo tee /usr/bin/ventoy
sudo chmod +x /usr/bin/ventoy
sudo echo "[Desktop Entry]
Name=Ventoy
Comment=Ventoy GUI
Exec=ventoy
Icon=ventoy
Terminal=false
Type=Application" | sudo tee /usr/share/applications/ventoy.desktop
sudo chmod +x /usr/share/applications/ventoy.desktop
}
remove() {
echo "Removing ventoy..."
sudo rm -rf /usr/bin/ventoy /usr/share/applications/ventoy.desktop /opt/ventoy*
}
update() {
echo "Updating $(echo /opt/ventoy*) to $file..."
remove && install
}
while getopts ":i?r?u?" options; do
case "${options}" in
i) if [ ! -d /opt/ventoy* ]; then
install
fi ;;
r) if [ -d /opt/ventoy* ]; then
remove
fi ;;
u) if [ /opt/$file != /opt/ventoy* ]; then
update
fi ;;
esac
done
@yucellmustafa
Copy link
Author

yucellmustafa commented May 4, 2022

Ventoy Install Script

  • first: sudo chmod +x ./ventoy_install.sh
  • install ./ventoy_install.sh -i
  • remove ./ventoy_install.sh -r
  • update ./ventoy_install.sh -u

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment