Finally made the move into Linux and decided the best way of learning the ropes was to try my hand at scripting.
Trying to make a basic (started really basic and keeps growing) script that automatically mounts or unmounts partitions based on user input. Thought i was on the right path but can't work out whats going wrong. Apologies in advance if it is just something really dumb.
#!/bin/bash # Test script to auto mount hdd based in user input echo "Do you wish to mount or unmount?" read origin if [ $origin == mount ]; then echo "Partitions : $(lsblk)" echo "Please enter device name e.g. sda1" read device echo "Please enter dir location e.g. /mnt" read location mount -t ntfs /dev/$device $location if [ $origin == unmount ]; then echo "Mounts : $(mount)" echo "Please enter mount location e.g. /mnt" read ulocation umount $ulocation fi