postbuild command fix.
This commit is contained in:
parent
3c6cd623af
commit
dd1adda1a6
9 changed files with 150 additions and 1 deletions
|
@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.23.0 FATAL_ERROR)
|
|||
|
||||
set(PROJECT AmneziaVPN)
|
||||
project(${PROJECT} VERSION 2.0.10)
|
||||
set(BUILD_ID 3)
|
||||
set(BUILD_ID 2)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.17)
|
||||
|
|
26
client/deploy/data/macos/AmneziaVPN.plist
Normal file
26
client/deploy/data/macos/AmneziaVPN.plist
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Label</key>
|
||||
<string>AmneziaVPN-service</string>
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>/Applications/AmneziaVPN.app/Contents/MacOS/AmneziaVPN-service</string>
|
||||
</array>
|
||||
<key>KeepAlive</key>
|
||||
<true/>
|
||||
<key>Sockets</key>
|
||||
<dict>
|
||||
<key>Listeners</key>
|
||||
<dict>
|
||||
<key>SockServiceName</key>
|
||||
<string>5959</string>
|
||||
<key>SockType</key>
|
||||
<string>stream</string>
|
||||
<key>SockFamily</key>
|
||||
<string>IPv4</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
BIN
client/deploy/data/macos/ck-client
Executable file
BIN
client/deploy/data/macos/ck-client
Executable file
Binary file not shown.
BIN
client/deploy/data/macos/openvpn
Executable file
BIN
client/deploy/data/macos/openvpn
Executable file
Binary file not shown.
35
client/deploy/data/macos/post_install.sh
Executable file
35
client/deploy/data/macos/post_install.sh
Executable file
|
@ -0,0 +1,35 @@
|
|||
#!/bin/bash
|
||||
|
||||
APP_NAME=AmneziaVPN
|
||||
PLIST_NAME=$APP_NAME.plist
|
||||
LAUNCH_DAEMONS_PLIST_NAME=/Library/LaunchDaemons/$PLIST_NAME
|
||||
LOG_FOLDER=/var/log/$APP_NAME
|
||||
LOG_FILE="$LOG_FOLDER/post-install.log"
|
||||
APP_PATH=/Applications/$APP_NAME.app
|
||||
|
||||
if launchctl list "$APP_NAME-service" &> /dev/null; then
|
||||
launchctl unload $LAUNCH_DAEMONS_PLIST_NAME
|
||||
rm -f $LAUNCH_DAEMONS_PLIST_NAME
|
||||
fi
|
||||
|
||||
tar xzf $APP_PATH/$APP_NAME.tar.gz -C $APP_PATH
|
||||
rm -f $APP_PATH/$APP_NAME.tar.gz
|
||||
sudo chmod -R a-w $APP_PATH/
|
||||
sudo chown -R root $APP_PATH/
|
||||
sudo chgrp -R wheel $APP_PATH/
|
||||
|
||||
rm -rf $LOG_FOLDER
|
||||
mkdir -p $LOG_FOLDER
|
||||
|
||||
echo "`date` Script started" > $LOG_FILE
|
||||
|
||||
killall -9 $APP_NAME-service 2>> $LOG_FILE
|
||||
|
||||
mv -f $APP_PATH/$PLIST_NAME $LAUNCH_DAEMONS_PLIST_NAME 2>> $LOG_FILE
|
||||
chown root:wheel $LAUNCH_DAEMONS_PLIST_NAME
|
||||
launchctl load $LAUNCH_DAEMONS_PLIST_NAME
|
||||
|
||||
echo "`date` Service status: $?" >> $LOG_FILE
|
||||
echo "`date` Script finished" >> $LOG_FILE
|
||||
|
||||
#rm -- "$0"
|
14
client/deploy/data/macos/post_uninstall.sh
Executable file
14
client/deploy/data/macos/post_uninstall.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/bash
|
||||
|
||||
APP_NAME=AmneziaVPN
|
||||
PLIST_NAME=$APP_NAME.plist
|
||||
LAUNCH_DAEMONS_PLIST_NAME=/Library/LaunchDaemons/$PLIST_NAME
|
||||
|
||||
if launchctl list "$APP_NAME-service" &> /dev/null; then
|
||||
launchctl unload $LAUNCH_DAEMONS_PLIST_NAME
|
||||
rm -f $LAUNCH_DAEMONS_PLIST_NAME
|
||||
fi
|
||||
|
||||
rm -rf "$HOME/Library/Application Support/$APP_NAME"
|
||||
rm -rf /var/log/$APP_NAME
|
||||
rm -rf /Applications/$APP_NAME.app/Contents
|
BIN
client/deploy/data/macos/ss-local
Executable file
BIN
client/deploy/data/macos/ss-local
Executable file
Binary file not shown.
BIN
client/deploy/data/macos/ss-tunnel
Executable file
BIN
client/deploy/data/macos/ss-tunnel
Executable file
Binary file not shown.
74
client/deploy/data/macos/update-resolv-conf.sh
Executable file
74
client/deploy/data/macos/update-resolv-conf.sh
Executable file
|
@ -0,0 +1,74 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Mac name-resolution updater based on @cl's script here:
|
||||
# https://blog.netnerds.net/2011/10/openvpn-update-client-dns-on-mac-os-x-using-from-the-command-line/
|
||||
# Openvpn envar parsing taken from the script in debian's openvpn package.
|
||||
# Smushed together and improved by @andrewgdotcom.
|
||||
|
||||
# Parses DHCP options from openvpn to update resolv.conf
|
||||
# To use set as 'up' and 'down' script in your openvpn *.conf:
|
||||
# up /etc/openvpn/update-resolv-conf
|
||||
# down /etc/openvpn/update-resolv-conf
|
||||
|
||||
[ "$script_type" ] || exit 0
|
||||
[ "$dev" ] || exit 0
|
||||
|
||||
PATH=$PATH:/usr/sbin/
|
||||
NMSRVRS=()
|
||||
SRCHS=()
|
||||
|
||||
# Get adapter list
|
||||
IFS=$'\n' read -d '' -ra adapters < <(networksetup -listallnetworkservices |grep -v denotes) || true
|
||||
|
||||
split_into_parts()
|
||||
{
|
||||
part1="$1"
|
||||
part2="$2"
|
||||
part3="$3"
|
||||
}
|
||||
|
||||
update_all_dns()
|
||||
{
|
||||
for adapter in "${adapters[@]}"
|
||||
do
|
||||
echo updating dns for $adapter
|
||||
# set dns server to the vpn dns server
|
||||
if [[ "${SRCHS[@]}" ]]; then
|
||||
networksetup -setsearchdomains "$adapter" "${SRCHS[@]}"
|
||||
fi
|
||||
if [[ "${NMSRVRS[@]}" ]]; then
|
||||
networksetup -setdnsservers "$adapter" "${NMSRVRS[@]}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
clear_all_dns()
|
||||
{
|
||||
for adapter in "${adapters[@]}"
|
||||
do
|
||||
echo updating dns for $adapter
|
||||
networksetup -setdnsservers "$adapter" empty
|
||||
networksetup -setsearchdomains "$adapter" empty
|
||||
done
|
||||
}
|
||||
|
||||
case "$script_type" in
|
||||
up)
|
||||
for optionvarname in ${!foreign_option_*} ; do
|
||||
option="${!optionvarname}"
|
||||
echo "$option"
|
||||
split_into_parts $option
|
||||
if [ "$part1" = "dhcp-option" ] ; then
|
||||
if [ "$part2" = "DNS" ] ; then
|
||||
NMSRVRS=(${NMSRVRS[@]} $part3)
|
||||
elif [ "$part2" = "DOMAIN" ] ; then
|
||||
SRCHS=(${SRCHS[@]} $part3)
|
||||
fi
|
||||
fi
|
||||
done
|
||||
update_all_dns
|
||||
;;
|
||||
down)
|
||||
clear_all_dns
|
||||
;;
|
||||
esac
|
Loading…
Add table
Add a link
Reference in a new issue