#!/bin/bash mountpoint="/media/player" deviceid="041e:4153" if mount | grep mtpfs > /dev/null; then if fusermount -u "$mountpoint"; then zenity --info --text "Player unmounted successfully." else zenity --error --text "Could not unmount, please close any open programs that are interfacing with the player." fi else if lsusb | grep "$deviceid" > /dev/null; then if mtpfs "$mountpoint"; then zenity --info --text "Player mounted successfully." else zenity --error --text "Could not mount, please make sure the player is connected properly." fi else zenity --error --text "Could not find player with deviceid: $deviceid on the usb bus, check the cable." fi fi