Kcptun installing get back.
This commit is contained in:
@ -83,6 +83,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
||||
InstallSSLocal()
|
||||
InstallPrivoxy()
|
||||
InstallSimpleObfs()
|
||||
InstallKcptun()
|
||||
|
||||
// Prepare defaults
|
||||
let defaults = UserDefaults.standard
|
||||
defaults.register(defaults: [
|
||||
|
@ -210,6 +210,26 @@ func InstallSimpleObfs() {
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
// MARK: kcptun
|
||||
|
||||
func InstallKcptun() {
|
||||
let fileMgr = FileManager.default
|
||||
let homeDir = NSHomeDirectory()
|
||||
let appSupportDir = homeDir+APP_SUPPORT_DIR
|
||||
if !fileMgr.fileExists(atPath: appSupportDir + "kcptun_\(KCPTUN_CLIENT_VERSION)/kcptun_client") {
|
||||
let bundle = Bundle.main
|
||||
let installerPath = bundle.path(forResource: "install_kcptun", ofType: "sh")
|
||||
let task = Process.launchedProcess(launchPath: "/bin/sh", arguments: [installerPath!])
|
||||
task.waitUntilExit()
|
||||
if task.terminationStatus == 0 {
|
||||
NSLog("Install kcptun succeeded.")
|
||||
} else {
|
||||
NSLog("Install kcptun failed.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
// MARK: privoxy
|
||||
|
||||
|
20
ShadowsocksX-NG/kcptun/install_kcptun.sh
Normal file
20
ShadowsocksX-NG/kcptun/install_kcptun.sh
Normal file
@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
# install_kcptun.sh
|
||||
# ShadowsocksX-NG
|
||||
#
|
||||
# Created by 邱宇舟 on 2018/9/21.
|
||||
# Copyright © 2018年 qiuyuzhou. All rights reserved.
|
||||
|
||||
# https://github.com/shadowsocks/kcptun/releases
|
||||
|
||||
VERSION="v20170718"
|
||||
|
||||
cd `dirname "${BASH_SOURCE[0]}"`
|
||||
|
||||
mkdir -p "$HOME/Library/Application Support/ShadowsocksX-NG/kcptun_$VERSION"
|
||||
cp -f kcptun_client "$HOME/Library/Application Support/ShadowsocksX-NG/kcptun_$VERSION/"
|
||||
|
||||
ln -sfh "$HOME/Library/Application Support/ShadowsocksX-NG/kcptun_$VERSION/kcptun_client" "$HOME/Library/Application Support/ShadowsocksX-NG/plugins/kcptun"
|
||||
|
||||
echo "install kcptun done"
|
BIN
ShadowsocksX-NG/kcptun/kcptun_client
Executable file
BIN
ShadowsocksX-NG/kcptun/kcptun_client
Executable file
Binary file not shown.
Reference in New Issue
Block a user