Perl script for unmouting/powering-off media/usb drives
Debian based distros:
sudo apt-get install perl udisks
Arch based distros:
The perl package for Perl 5 is installed as part of the base group during Arch Linux installation. https://wiki.archlinux.org/index.php/Perl#Installation
sudo pacman -S udisks
perl mounted-partitions-control.pl
After running this command you will be prompted to type ID of the drive you wish to unmount/power-off. IDs will be marked on STDOUT
. After you type ID and press ENTER this script will call udisksctl
command with your subshell and attempt to unmount and power-off selected drive.