openvpn.patch 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. --- a/package/feeds/custom/openvpn/files/etc/hotplug.d/openvpn/01-user
  2. +++ b/package/feeds/custom/openvpn/files/etc/hotplug.d/openvpn/01-user
  3. @@ -2,10 +2,10 @@
  4. . /lib/functions/openvpn.sh
  5. -[ -e "/etc/openvpn.user" ] && {
  6. +[ -e "/etc/openvpn/openvpn.user" ] && {
  7. env -i ACTION="$ACTION" INSTANCE="$INSTANCE" \
  8. /bin/sh \
  9. - /etc/openvpn.user \
  10. + /etc/openvpn/openvpn.user \
  11. $*
  12. }
  13. --- a/package/feeds/custom/openvpn/files/openvpn.init
  14. +++ b/package/feeds/custom/openvpn/files/openvpn.init
  15. @@ -107,7 +107,6 @@
  16. local name="$1"
  17. local dir="$2"
  18. local conf="$3"
  19. - local security="$4"
  20. procd_open_instance "$name"
  21. procd_set_param command "$PROG" \
  22. @@ -117,7 +116,7 @@
  23. --config "$conf" \
  24. --up "/usr/libexec/openvpn-hotplug up $name" \
  25. --down "/usr/libexec/openvpn-hotplug down $name" \
  26. - --script-security "${security:-2}" \
  27. + --script-security 2 \
  28. $(openvpn_get_dev "$name" "$conf")
  29. procd_set_param file "$dir/$conf"
  30. procd_set_param term_timeout 15
  31. @@ -139,14 +138,11 @@
  32. return 1
  33. }
  34. - local script_security
  35. - config_get script_security "$s" script_security
  36. -
  37. [ ! -d "/var/run" ] && mkdir -p "/var/run"
  38. if [ ! -z "$config" ]; then
  39. append UCI_STARTED "$config" "$LIST_SEP"
  40. - openvpn_add_instance "$s" "${config%/*}" "$config" "$script_security"
  41. + openvpn_add_instance "$s" "${config%/*}" "$config"
  42. return
  43. fi
  44. @@ -157,7 +153,7 @@
  45. append_params "$s" $OPENVPN_PARAMS
  46. append_list "$s" $OPENVPN_LIST
  47. - openvpn_add_instance "$s" "/var/etc" "openvpn-$s.conf" "$script_security"
  48. + openvpn_add_instance "$s" "/var/etc" "openvpn-$s.conf"
  49. }
  50. start_service() {
  51. --- a/package/feeds/custom/openvpn/Makefile
  52. +++ b/package/feeds/custom/openvpn/Makefile
  53. @@ -100,20 +100,13 @@
  54. )
  55. endef
  56. -define Package/openvpn-$(BUILD_VARIANT)/conffiles
  57. -/etc/config/openvpn
  58. -/etc/openvpn.user
  59. -endef
  60. -
  61. define Package/openvpn-$(BUILD_VARIANT)/install
  62. $(INSTALL_DIR) \
  63. $(1)/usr/sbin \
  64. $(1)/usr/share/openvpn \
  65. $(1)/etc/init.d \
  66. - $(1)/etc/config \
  67. $(1)/etc/openvpn \
  68. $(1)/lib/functions \
  69. - $(1)/lib/upgrade/keep.d \
  70. $(1)/usr/libexec \
  71. $(1)/etc/hotplug.d/openvpn
  72. @@ -139,18 +132,11 @@
  73. $(INSTALL_DATA) \
  74. files/etc/openvpn.user \
  75. - $(1)/etc/openvpn.user
  76. + $(1)/etc/openvpn/openvpn.user
  77. $(INSTALL_DATA) \
  78. files/openvpn.options \
  79. $(1)/usr/share/openvpn/openvpn.options
  80. -
  81. - $(INSTALL_CONF) files/openvpn.config \
  82. - $(1)/etc/config/openvpn
  83. -
  84. - $(INSTALL_DATA) \
  85. - files/openvpn.upgrade \
  86. - $(1)/lib/upgrade/keep.d/openvpn
  87. endef
  88. $(eval $(call BuildPackage,openvpn-openssl))