#!/bin/sh _name="ventoy" _PREFIX="/usr/libexec/${_name}" _SHAREPREFIX="/usr/share/${_name}" config_dir="${XDG_CONFIG_HOME:-$HOME/.config}/$_name" # clone directory tree and symlink all files in config cp -nas "${_PREFIX}" "${XDG_CONFIG_HOME:-$HOME/.config}" cp -nas "${_SHAREPREFIX}" "${XDG_CONFIG_HOME:-$HOME/.config}" cd "$config_dir" || exit 1 # from name of the symlink launch appropriate script case "${0##*/}" in "${_name}2disk") exec ./Ventoy2Disk.sh "$@" ;; "${_name}gui") exec ./VentoyGUI "$@" ;; "${_name}plugson") exec ./VentoyPlugson.sh "$@" ;; "${_name}web") exec ./VentoyWeb.sh "$@" ;; "${_name}-create-persistent") exec ./CreatePersistentImg.sh "$@" ;; "${_name}-extend-persistent") exec ./ExtendPersistentImg.sh "$@" ;; "${_name}vlink") exec ./VentoyVlnk.sh "$@" ;; *) echo "Something is wrong with your installation." ;; esac cd - &>/dev/null