When it is connected to a particular WiFi, the script to stop the process of Amazon WorkDocs sync client. Coding in PoweShell. Published in this URL: http://qiita.com/yo1t/items/bf9d3c3c6baeaaafc681
https://github.com/yo1t/WorkDocs-NWchecker/releases
- Manual Setup
- Put workdocs-NWchecker.ps1 to the appropriate folder.
- Installer (copy to c:\tools)
- cd installer\windows
- setup.bat
- Manual Setup
- I checked MacOS X El capitan and MacOS Sierra.
- At the first, install PowerShell for Mac OS X. Download the latest .pkg from the link of the following.
- Put workdocs-NWchecker.ps1 to the appropriate folder.
- Installer (copy to /usr/local/bin/)
- cd ./installer/MacOS
- chmod +x install.sh
- ./install.sh
-
Run the powershell workdocs-NWchecker.ps1. (Example: powershell workdocs-NWchecker.ps1 -t 30 -ssid yo1-mobile -interface en1)
- -t [interval (second)] to check the process specified in the number of seconds. (Can be specified from 3 seconds to 3600 seconds.) Example: -t 30
- -ssid [WiFi-SSID] specified WiFi SSID to be checked. Example: -ssid yo1-007
- -bssid [WiFi-BSSID] BSSID is not SSID. specified WiFi BSSID to be checked. Example: -bssid XX:XX:XX:XX:XX:XX
- -interface [ethernet device name] specified USB tethering interface to be checked. Example: -interface 'en1'
-
If your WorkDocs is started with administrative privileges, PowerShell also start with administrator privileges.
-
If you use installer for MacOS, this install script make excutable script at /usr/local/bin/workdocs-NWChecker.
-
This script is suported both Windows and MacOS, one script. Although, I don't have good information of identification method of the OS in the PowerShell. If $Home does not contains ":"(C: If you do not include a drive letter, etc.), determined MacOS.
Amazon WorkDocs sync クライアントをある特定のWiFiに接続されている時は、プロセスを停止するスクリプト。PoweShellでコーディング。
このURLで公開: http://qiita.com/yo1t/items/bf9d3c3c6baeaaafc681
https://github.com/yo1t/WorkDocs-NWchecker/releases
- マニュアルセットアップ
- workdocs-NWchecker.ps1 を適当なフォルダに置く。
- インストーラ (c:\toolsにコピーします。)
- cd installer\windows
- setup.bat
- マニュアルセットアップ
- MacOS X El capitan, MacOS Sierraで動作確認済み。
- Mac OS X用のPowerShellをインストール。下記ののリンクから最新の.pkgをダウンロードし、インストールする。
- workdocs-NWchecker.ps1 を適当なフォルダに置く。
- インストーラー (/usr/local/binにコピーします。)
- cd ./installer/MacOS
- chmod +x install.sh
- ./install.sh
-
powershell workdocs-NWchecker.ps1 を実行。(例: powershell workdocs-NWchecker.ps1 -t 30 -ssid yo1-mobile -interface 'Bluetooth ネットワーク接続' )
- -t [interval(second) ] 指定した秒数でプロセスをチェックする。(3秒から3600秒まで指定可能。) 例: -t 30
- -ssid [WiFi-SSID ] 指定したWiFi SSIDをチェック対象にする。 例: -ssid yo1-007
- -bssid [WiFi-BSSID] BSSIDはSSIDと異なります。同じSSIDでAPを設定していても、BSSIDは異なるのが一般的です。指定したBSSIDをチェック対象にする。 例: -bssid XX:XX:XX:XX:XX:XX
- -interface [デバイス名] 指定したデバイス名のステータスをチェック対象にする。デバイス名はipconfig(Win), ifconfig(MacOS)で探してください。 例: -interface 'Bluetooth ネットワーク接続' ※シングルクォーテーションで囲む('')
-
WorkDocsが管理者権限で起動されている場合は、PowerShellも管理者権限で起動する。
-
MacOS用のインストーラでセットアップした場合は、/usr/local/bin/workdocs-NWchecker という名前の実行可能なスクリプトを作成します。
-
このスクリプトは、Windows/MacOS両対応です。PowerShellでのOSの識別方法がいまいち不明ではあるが、$Homeに「:」が含まれる場合は(C:などのドライブレターが含まれない場合は)MacOSとして判断しています。
なお、このソースコード、ドキュメントに関して、私の所属している組織は一切関係ありません。
Yoichi Takizawa