OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
2.4 KiB

  1. #!/bin/sh
  2. #
  3. # --- T2-COPYRIGHT-NOTE-BEGIN ---
  4. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  5. #
  6. # T2 SDE: package/.../autofs/autofs.init
  7. # Copyright (C) 2004 - 2006 The T2 SDE Project
  8. # Copyright (C) 1998 - 2003 Clifford Wolf
  9. #
  10. # More information can be found in the files COPYING and README.
  11. #
  12. # This program is free software; you can redistribute it and/or modify
  13. # it under the terms of the GNU General Public License as published by
  14. # the Free Software Foundation; version 2 of the License. A copy of the
  15. # GNU General Public License can be found in the file COPYING.
  16. # --- T2-COPYRIGHT-NOTE-END ---
  17. #
  18. # Desc: Kernel Automounter Daemon
  19. # Runlevel: 74 rcX
  20. #
  21. PATH=/sbin:/usr/sbin:/bin:/usr/bin
  22. export PATH
  23. # We can add local options here
  24. # e.g. localoptions='rsize=8192,wsize=8192'
  25. #
  26. localoptions=''
  27. function getmounts()
  28. {
  29. if [ -f /etc/auto.master ]
  30. then
  31. cat /etc/auto.master | sed -e '/^#/d' -e '/^$/d'| (
  32. while read dir map options
  33. do
  34. if [ ! -z "$dir" -a ! -z "$map" \
  35. -a "$(echo "$map" | cut -c1)" != "-" ]
  36. then
  37. map=$(echo "/etc/$map" | sed -e 's:^/etc//:/:')
  38. options=$(echo "$options" | sed -e 's/\(^\|[ \t]\)-/\1/g')
  39. if [ -x $map ]; then
  40. echo "automount $dir program $map $options $localoptions"
  41. elif [ -f $map ]; then
  42. echo "automount $dir file $map $options $localoptions"
  43. else
  44. echo "automount $dir $(basename $map) $options $localoptions"
  45. fi
  46. fi
  47. done
  48. )
  49. fi
  50. }
  51. function status()
  52. {
  53. echo "Configured Mount Points:"
  54. echo "------------------------"
  55. getmounts
  56. echo ""
  57. echo "Active Mount Points:"
  58. echo "--------------------"
  59. ps ax|grep "[0-9]:[0-9][0-9] automount " | (
  60. while read pid tt stat time command; do echo $command; done
  61. )
  62. }
  63. main_begin
  64. block_begin(start, `Starting automounter.')
  65. check(`getmounts | sh -e')
  66. block_end
  67. block_begin(stop, `Stopping automounter.')
  68. check(`killall automount')
  69. if sleep 1 ; [ "$(pidof /usr/sbin/automount)" ] ; then
  70. check(`killall -9 automount')
  71. fi
  72. if sleep 1 ; [ "$(pidof /usr/sbin/automount)" ] ; then
  73. echo "Not able to stop processes: $(pidof /usr/sbin/automount)"
  74. IN error=1
  75. fi
  76. block_end
  77. block_begin(status)
  78. status
  79. block_end
  80. main_end