rwxrob-dot/scripts/eject

8 lines
199 B
Plaintext
Raw Normal View History

2022-02-09 07:29:05 +00:00
#!/bin/sh
path=/media/$USER
first=$(ls -1 $path | head -1)
mpoint=$path/$first
[ -z "$first" ] && tell 'Nothing to eject.' && exit
umount $mpoint && tell "$first ejected" || tell 'Could not eject.'