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.

90 lines
2.5 KiB

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