vpn_routing_mac 0.1.3 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4d6921de969faaa64707cef893d41296801fec51c41fcf6dd17846a304606934
4
- data.tar.gz: 4bd46fde57af68ede035f41ab67df62f766aed0ab8195c6b1b51e235dcb56cc2
3
+ metadata.gz: bfe0ab3fa27c35f96f44fd0f0c2b671c412c8dac0a922a0ea4b7a24186cc70b6
4
+ data.tar.gz: 3fad9df0bf8ee0e53b57e08bd1b9b8e13ed35b0f5413b87bbfa0258c7d9fa6fa
5
5
  SHA512:
6
- metadata.gz: 8cc057be3e4bc2f998c5bbce2499037be8ea7ce6968f29d68d76dabfa74e2bf79181dbd020e29ce7ddc7bc501e6e9e368604474656d3f130f8d4ef1dd075ab06
7
- data.tar.gz: 42d8aa7f1693e0398bf5f5e51036372f6001def3d44e0994a9b20f65351e53fc5957e4097cc0ce9609bf51179531fd1d35fcc7f39735d5b6ce34af6c9b0e80b4
6
+ metadata.gz: e94b544cc32a45514905f4111da66dc84b01c4aaf2f56d0593e907e842bc4116f1c19ee56eab352432c560f39f3110e535fe0d622a3f3a54a85d0d4fd125158f
7
+ data.tar.gz: 7089d7d50a5b74e380448c9e9e3b06c9f2d5b1cdb2acf12b66cbff579c3e983c557e303f369bf1a2af2cec99e788e9e54ea003d7a9bae88799d112f9877f15d4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vpn_routing_mac (0.1.3)
4
+ vpn_routing_mac (0.2.0)
5
5
  thor (~> 1.1.0)
6
6
 
7
7
  GEM
@@ -3,7 +3,7 @@ module VpnRoutingMac
3
3
  # required: sudo
4
4
  def install
5
5
  if ip_up_path.exist?
6
- backup_ip_up! if ip_up_path.exist?
6
+ backup_ip_up!
7
7
  ip_up_path.delete
8
8
  end
9
9
 
@@ -25,8 +25,16 @@ module VpnRoutingMac
25
25
  active_interface_name = CommandExecutor.instance.execute!(cmd_active_interface_name, exception: false).strip
26
26
  raise DefaultGatewayNotFound if active_interface_name == ""
27
27
 
28
- cmd = "/sbin/route change default -interface #{active_interface_name}"
29
- CommandExecutor.instance.execute!(cmd)
28
+ # Big Sur以降ではコマンドが異なるので注意。
29
+ os_version = CommandExecutor.instance.execute!("sw_vers | grep ProductVersion | awk '{print $2}'").strip
30
+ if Gem::Version.create("12.5.0") > Gem::Version.create(os_version)
31
+ cmd = "/sbin/route change default -interface #{active_interface_name}"
32
+ CommandExecutor.instance.execute!(cmd)
33
+ else # Big Sur以降
34
+ gateway_ip = CommandExecutor.instance.execute!("/sbin/route -n get default | grep gateway | awk '{print $2}'").strip
35
+ CommandExecutor.instance.execute!("/sbin/route -n delete default")
36
+ CommandExecutor.instance.execute!("/sbin/route add default #{gateway_ip}")
37
+ end
30
38
  end
31
39
 
32
40
  def recent_vpn_log_path
@@ -1,3 +1,3 @@
1
1
  module VpnRoutingMac
2
- VERSION = "0.1.3"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vpn_routing_mac
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuji Kuroko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-31 00:00:00.000000000 Z
11
+ date: 2022-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  requirements: []
77
- rubygems_version: 3.0.3
77
+ rubygems_version: 3.0.3.1
78
78
  signing_key:
79
79
  specification_version: 4
80
80
  summary: Mac VPN routing setting tool.