smb-umount
This commit is contained in:
@@ -6,8 +6,12 @@
|
||||
# Requirements:
|
||||
# - cifs-utils
|
||||
# - ./issu
|
||||
# - sudo privileges
|
||||
|
||||
issu && {
|
||||
|
||||
path=$(dirname "$(realpath "$0")")
|
||||
|
||||
"$path"/issu && {
|
||||
echo "Do not run this script in sudo mode."
|
||||
exit 1
|
||||
}
|
||||
|
||||
31
config/scripts/.local/scripts/smb-umount
Executable file
31
config/scripts/.local/scripts/smb-umount
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Description:
|
||||
# Unmount all cifs mounts
|
||||
#
|
||||
# Requirements:
|
||||
# - cifs-utils
|
||||
# - ./issu
|
||||
# - sudo privileges
|
||||
|
||||
path=$(dirname "$(realpath "$0")")
|
||||
|
||||
"$path"/issu && {
|
||||
echo "Do not run this script in sudo mode."
|
||||
exit 1
|
||||
}
|
||||
|
||||
mount_points=$(mount | grep ' type cifs ' | awk '{print $3}')
|
||||
|
||||
[ -z "$mount_points" ] && {
|
||||
echo "No cifs mounts found."
|
||||
exit 0
|
||||
}
|
||||
|
||||
for mp in $mount_points; do
|
||||
echo "Unmounting $mp"
|
||||
sudo umount "$mp" || {
|
||||
echo "Failed to unmount $mp"
|
||||
exit 1
|
||||
}
|
||||
done
|
||||
@@ -12,7 +12,10 @@
|
||||
# - A common issue is that the VHDX file has logs that needs to be "replayed".
|
||||
# This can be done using `qemu-img check -r all <VHDX_PATH>`
|
||||
|
||||
issu && {
|
||||
|
||||
path=$(dirname "$(realpath "$0")")
|
||||
|
||||
"$path"/issu && {
|
||||
echo "Do not run this script in sudo mode."
|
||||
exit 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user