multilevel-init.patch 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. --- /etc/init.d/openvpn 2004-05-12 20:30:06.000000000 +0200
  2. +++ openvpn 2004-05-12 20:34:33.000000000 +0200
  3. @@ -58,13 +58,13 @@
  4. # returning success or failure status to caller (James Yonan).
  5. # Location of openvpn binary
  6. -openvpn="/usr/sbin/openvpn"
  7. +openvpn=/usr/sbin/openvpn
  8. # Lockfile
  9. -lock="/var/lock/subsys/openvpn"
  10. +lock=/var/lock/subsys/openvpn
  11. # PID directory
  12. -piddir="/var/run/openvpn"
  13. +piddir=/var/run/openvpn
  14. # Our working directory
  15. work=/etc/openvpn
  16. @@ -106,7 +106,7 @@
  17. if [ -f $lock ]; then
  18. # we were not shut down correctly
  19. - for pidf in `/bin/ls $piddir/*.pid $piddir/*/*.pid 2>/dev/null`; do
  20. + for pidf in `find $piddir -name "*.pid" 2>/dev/null`; do
  21. if [ -s $pidf ]; then
  22. kill `cat $pidf` >/dev/null 2>&1
  23. fi
  24. @@ -116,12 +116,12 @@
  25. sleep 2
  26. fi
  27. - rm -f $piddir/*.pid $piddir/*/*.pid
  28. + find $piddir -name "*.pid"|xargs rm -f
  29. # Start every .conf in $work and run .sh if exists
  30. errors=0
  31. successes=0
  32. - for c in `/bin/ls *.conf */*.conf 2>/dev/null`; do
  33. + for c in `find * -name "*.conf" 2>/dev/null`; do
  34. bn=${c%%.conf}
  35. if [ -f "$bn.sh" ]; then
  36. . $bn.sh
  37. @@ -147,7 +147,7 @@
  38. ;;
  39. stop)
  40. echo -n $"Shutting down openvpn: "
  41. - for pidf in `/bin/ls $piddir/*.pid $piddir/*/*.pid 2>/dev/null`; do
  42. + for pidf in `find $piddir -name "*.pid" 2>/dev/null`; do
  43. if [ -s $pidf ]; then
  44. kill `cat $pidf` >/dev/null 2>&1
  45. fi
  46. @@ -163,7 +163,7 @@
  47. ;;
  48. reload)
  49. if [ -f $lock ]; then
  50. - for pidf in `/bin/ls $piddir/*.pid $piddir/*/*.pid 2>/dev/null`; do
  51. + for pidf in `find $piddir -name "*.pid" 2>/dev/null`; do
  52. if [ -s $pidf ]; then
  53. kill -HUP `cat $pidf` >/dev/null 2>&1
  54. fi
  55. @@ -175,7 +175,7 @@
  56. ;;
  57. reopen)
  58. if [ -f $lock ]; then
  59. - for pidf in `/bin/ls $piddir/*.pid $piddir/*/*.pid 2>/dev/null`; do
  60. + for pidf in `find $piddir -name "*.pid" 2>/dev/null`; do
  61. if [ -s $pidf ]; then
  62. kill -USR1 `cat $pidf` >/dev/null 2>&1
  63. fi
  64. @@ -195,7 +195,7 @@
  65. ;;
  66. status)
  67. if [ -f $lock ]; then
  68. - for pidf in `/bin/ls $piddir/*.pid $piddir/*/*.pid 2>/dev/null`; do
  69. + for pidf in `find $piddir -name "*.pid" 2>/dev/null`; do
  70. if [ -s $pidf ]; then
  71. kill -USR2 `cat $pidf` >/dev/null 2>&1
  72. fi