1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Mac起動時に自動でVPN接続する

Posted at

VPNに常時接続する必要があり、いちいち手動でポチポチするのがめんどくさいので起動時に自動接続するようにします。
スクリプトエディタを開いて以下をAppleScriptとして保存。

tell application "System Events"
	tell current location of network preferences
		set myVpnService to the service "VPNの表示名"
		
		if current configuration of myVpnService is not connected then
			connect myVpnService
		end if
	end tell
end tell

VPNの表示名はシステム設定 > VPNの赤枠の部分。

スクリーンショット 2023-04-17 14.26.25.png

システム設定 > 一般 > ログイン項目ログイン時に開くに追加して完了:ok_hand:

スクリーンショット 2023-04-17 14.48.07.png

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?