-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReMount-sda1.sh
More file actions
executable file
·77 lines (52 loc) · 1.23 KB
/
ReMount-sda1.sh
File metadata and controls
executable file
·77 lines (52 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
#Mar 04, 2020, 03:44:27
title="SanDisk /SRC Mount"
prompt="Pick an option:"
options=("REmount SanDisk" "Unmount Sandisk" "Force Unmount(Danger!)")
echo ""
echo -e "\033[1;31m""$title""\033[m"
echo ""
PS3="$prompt "
select opt in "${options[@]}" "Quit"; do
case "$REPLY" in
1 ) clear
echo "$opt"
echo ""
sudo umount -r /dev/sda1
echo "Unmounting sda1"
echo ""
sleep 1
echo "Mounting /usr/src to /dev/sda1"
echo ""
sudo mount --make-rslave /dev/sda1 /usr/src
sleep 1
echo "DONE!"
echo ""
echo "Dont forget to Unmount before you remove the USB"
echo ""
read -p -r "Press [Enter] key to exit..."
xdg-open /usr/src
exit;;
2 ) clear
echo "$opt"
echo ""
sudo umount -r /dev/sda1
sleep 1
echo ""
echo "DONE"
sleep 2
exit;;
3 ) clear
echo "$opt"
echo ""
echo "fuser force killing mount"
sleep 2
sudo fuser -k /usr/src
sudo fuser -k /dev/sda1
sudo umount -f /dev/sda1
read -p -r "Press [Enter] key to exit..."
exit;;
$(( ${#options[@]}+1 )) ) echo "Goodbye!"; break;;
*) echo "Invalid option. Try another one.";continue;;
esac
done