Add a script to remount devices with default value
This commit is contained in:
parent
041d5cd05d
commit
de6a86ba5d
|
@ -0,0 +1,18 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Remount with default values from /etc/fstab all mountpath
|
||||
|
||||
if [ "$(id -u)" -eq 0 ]; then
|
||||
# get the mountpath list from fstab
|
||||
for mountpath in $(grep -v -E "(^#|none)" /etc/fstab | awk '{print $2}'); do
|
||||
# ensure "${mountpath}" is already mounted
|
||||
if grep -q " ${mountpath} " /etc/mtab; then
|
||||
mount "${mountpath}" -o remount
|
||||
#printf '%b\n' "mount ${mountpath} -o remount"
|
||||
fi
|
||||
done
|
||||
else
|
||||
sudo "${0}"
|
||||
fi
|
||||
|
||||
exit 0
|
Loading…
Reference in New Issue