双系统时,挂载笔记本电脑上的 Arch 中的项目到移动硬盘上的 Ubuntu
#!/bin/bash
if [ -z "$(sudo fdisk -l | grep nvme0n1p8 | head -n 1)" ]; then
echo -e "\nno nvme0n1p8\n"
exit 0
fi
PARAM="${1}"
if [ -h "/home/jetsung/projects" ]; then
rm -rf /home/jetsung/projects
fi
if [ "${PARAM}x" = "x" ]; then
sudo mount /dev/nvme0n1p8 /opt/nvme
ln -s /opt/nvme/jetsung/projects /home/jetsung/
else
sudo umount /opt/nvme
fi