tweaked automountctl
added some comments added some helpfull output some indentation
This commit is contained in:
29
automountctl
29
automountctl
@@ -1,19 +1,23 @@
|
||||
#!/bin/bash
|
||||
command="${1}"
|
||||
|
||||
# test if gsettings tool is installed
|
||||
if ! (which gsettings 1>/dev/null) ; then
|
||||
echo "need gsettings"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#test for existing mate settings
|
||||
if (gsettings get org.mate.media-handling automount 1>/dev/null) ; then
|
||||
mate=1
|
||||
fi
|
||||
|
||||
#test for existing gnome settings
|
||||
if (gsettings get org.gnome.desktop.media-handling automount 1>/dev/null) ; then
|
||||
gnome=1
|
||||
fi
|
||||
|
||||
#test if at least one of the known settings where found
|
||||
if [ -z $mate ] && [ -z $gnome ] ; then
|
||||
echo "No supported Settings found"
|
||||
echo "mate : org.mate.media-handling automount"
|
||||
@@ -45,23 +49,28 @@ gsettings set org.gnome.desktop.media-handling automount-open false
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "status"
|
||||
|
||||
echo "Status:"
|
||||
if [ $mate -eq "1" ] ; then
|
||||
echo "# mate-settings found"
|
||||
echo "## org.mate.media-handling automount :"
|
||||
echo "# mate-settings found:"
|
||||
echo " - org.mate.media-handling automount :"
|
||||
echo -n " "
|
||||
gsettings get org.mate.media-handling automount
|
||||
echo "## org.mate.media-handling automount-open :"
|
||||
echo " - org.mate.media-handling automount-open :"
|
||||
echo -n " "
|
||||
gsettings get org.mate.media-handling automount-open
|
||||
fi
|
||||
|
||||
if [ $gnome -eq "1" ] ; then
|
||||
echo "# gnome-settings found"
|
||||
echo "## org.gnome.desktop.media-handling automount :"
|
||||
echo "# gnome-settings found:"
|
||||
echo " - org.gnome.desktop.media-handling automount :"
|
||||
echo -n " "
|
||||
gsettings get org.gnome.desktop.media-handling automount
|
||||
echo "## org.gnome.desktop.media-handling automount-open :"
|
||||
echo " - org.gnome.desktop.media-handling automount-open :"
|
||||
echo -n " "
|
||||
gsettings get org.gnome.desktop.media-handling automount-open
|
||||
fi
|
||||
|
||||
|
||||
echo "-------------------"
|
||||
echo "usage:"
|
||||
echo " $0 on : turn on automount"
|
||||
echo " $0 off : turn off automount"
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user