Commit 0db53c6b authored by Vitaly Lipatov's avatar Vitaly Lipatov

modify text out after test review, add print mounted resources in etermount

parent 91901806
......@@ -131,6 +131,7 @@ SRC_DIR=%_usrsrc/%name-%version
MODULENAME=%name
MODULEFILENAME=%name.ko
MODULEVERSION=%version
PACKAGEVEREL=%version-%release
CHECK_VERSION=1
EOF
......
......@@ -19,7 +19,7 @@ INSMOD=/sbin/insmod
PACKAGEINFO=@DATADIR@/package.conf
if [ -f "$PACKAGEINFO" ] ; then
. $PACKAGEINFO/package.conf
. $PACKAGEINFO
else
fatal "Not found package information file $PACKAGEINFO"
fi
......@@ -158,18 +158,16 @@ load_module()
success
fi
echo -n "Loading kernel module $MODULENAME... "
get_module_version
echo -n "Loading kernel module $MODULENAME $MODVER... "
if [ "$MODULEVERSION" != "$MODVER" ] && [ "$CHECK_VERSION" -eq 1 ] ; then
[ $MODVER ] && {
failure
show_module_version
echo " Please, run 'service etercifs build' to build the etercifs module (recommended)"
#echo " or run 'CHECK_VERSION=0 service etercifs restart' to disable check."
return
}
fi
$MODPROBE $MODULENAME && { success ; return ; }
......@@ -201,7 +199,6 @@ stop()
show_module_version()
{
echo " package $MODULENAME version $MODULEVERSION"
if [ $MODVER ] ; then
echo " kernel module $MODULENAME version $MODVER is built for current kernel"
else
......@@ -227,6 +224,7 @@ show_loaded_module_version()
status()
{
local PRECOMP
echo "Package $MODULENAME $PACKAGEVEREL"
echo "CIFS kernel module status:"
if is_moduled ; then
get_module_version
......
......@@ -13,7 +13,7 @@ fatal()
PACKAGEINFO=@DATADIR@/package.conf
if [ -f "$PACKAGEINFO" ] ; then
. $PACKAGEINFO/package.conf
. $PACKAGEINFO
else
fatal "Not found package information file $PACKAGEINFO"
fi
......@@ -44,10 +44,11 @@ create_share_dir()
help_text()
{
echo "Package $MODULENAME version $MODULEVERSION"
echo "The utility etermount performs mount network share on a protocol cifs"
echo "with pre-set parameters, which determined in MOUNT_OPTIONS variable"
echo "in the config file $CONFIGFILE"
echo "(current value of MOUNT_OPTIONS is '$MOUNT_OPTIONS')"
echo "(current value is '$MOUNT_OPTIONS')"
echo
echo "To mount the resource //server/share to the mountpoint /path/mountpoint"
echo "need to execute the command (with root permissions):"
......@@ -56,15 +57,20 @@ help_text()
echo
echo "If the mountpoint isn't specified, will used"
echo "variable DEFAULT_MOUNTPOINT from the config file $CONFIGFILE"
echo "(current value of DEFAULT_MOUNTPOINT is '$DEFAULT_MOUNTPOINT')."
echo "(current value is '$DEFAULT_MOUNTPOINT')."
echo
echo "Report bugs to <support@etersoft.ru>."
}
[ "$1" == '--help' -o "$1" == '-h' ] && { help_text ; exit 0 ; }
if [ -z "$@" ] ; then
cat /proc/mounts | grep cifs
exit
fi
# FIXME: Lav 19.02.10: I think, default mount path is useless
[ "$#" -ge 1 -a "$#" -le 2 ] || fatal 'Usage: etermount <//server/share> [</path/mountpoint>]'
[ "$#" -ge 1 -a "$#" -le 2 ] || fatal 'Usage: etermount <//server/share> [</path/mountpoint>]. Use -h or --help options for help.'
if [ "$2" == '' ] ; then
SHARE_PATH=$DEFAULT_MOUNTPOINT
......@@ -74,7 +80,8 @@ fi
create_share_dir "$SHARE_PATH"
if $($SUDO mount -t cifs "$1" "$SHARE_PATH" -o $MOUNT_OPTIONS) ; then
echo "Mouting share $1 to $SHARE_PATH with $MOUNT_OPTIONS options..."
if $SUDO mount -t cifs "$1" "$SHARE_PATH" -o $MOUNT_OPTIONS ; then
echo "Info: mount of share $1 in mountpoint $SHARE_PATH has been successfully"
else
fatal "Warning: error while mount of share $1 in mountpoint $SHARE_PATH!"
......
......@@ -9,7 +9,7 @@
PACKAGEINFO=@DATADIR@/package.conf
if [ -f "$PACKAGEINFO" ] ; then
. $PACKAGEINFO/package.conf
. $PACKAGEINFO
else
fatal "Not found package information file $PACKAGEINFO"
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment