#!/bin/bash # # Replace the "[VOLUME_ID]" part with the volume label or identification # (ID) of your external USB hard drive. The point of this is to be able # to store configurations and resources tied to a program on an external # hard drive. Some applications require a lot of assets, resources, # large databases, and etc.. Also, you may be wanting to run a program # but keep the required/associated files on an encrypted hard drive, # partition, or disk image. # # Do not forget to replace the "Program" and "Program Name" parts, as # well as paths. # # This script is what you would tell a *.desktop file to use, such as # Exec=sh -c "/path/to/thisScript.sh" # # If the program in question does not have any command-line arguments # to specify a different location to a configuration, creat a symbolic # link to the file or folder from the USB hard drive to the system # hard drive. # # If 'libnotify' is not installed, 'xterm' will pop-up, using 'dialog' # to display a message instead if needed. # # Requires 'xterm' and 'dialog' to be installed, but most GNU/Linux # systems have these by default. # if [ ! -d "/media/$USER/[VOLUME_ID]" ] then if [ -f '/usr/bin/notify-send' ] then notify-send 'Hard drive not mounted.' notify-send 'Minetest will not start.' else xterm -T 'Program Name: Whoops...' -e dialog --msgbox "Hard drive not mounted.\Program will not start." 0 0 fi else sh -c "/path/to/program" fi