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