mirror of
https://github.com/TrustTunnel/TrustTunnel.git
synced 2026-10-14 03:43:25 +00:00
Add macOS support to install.sh (PR 20)
Some checks failed
Lint Markdown / lint (push) Has been cancelled
Lint Rust / lint (push) Has been cancelled
Mirror to public repository / Mirror to public repository (push) Has been cancelled
Run tests / Linux build (push) Has been cancelled
Run tests / Mac build (push) Has been cancelled
Run tests (public) / Linux (push) Has been cancelled
Run tests (public) / macOS (push) Has been cancelled
Some checks failed
Lint Markdown / lint (push) Has been cancelled
Lint Rust / lint (push) Has been cancelled
Mirror to public repository / Mirror to public repository (push) Has been cancelled
Run tests / Linux build (push) Has been cancelled
Run tests / Mac build (push) Has been cancelled
Run tests (public) / Linux (push) Has been cancelled
Run tests (public) / macOS (push) Has been cancelled
This commit is contained in:
parent
db19aab453
commit
e79e6aafa5
2 changed files with 31 additions and 7 deletions
|
|
@ -8,6 +8,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|||
|
||||
### Added
|
||||
|
||||
- [Feature] macOS support in `scripts/install.sh`: on Darwin the script now downloads and installs the `macos-universal` release package instead of failing with "Unsupported operating system: 'Darwin'". The Linux-only systemd setup hints are not shown on macOS.
|
||||
|
||||
### Changed
|
||||
|
||||
### Deprecated
|
||||
|
|
|
|||
|
|
@ -103,10 +103,9 @@ set_os() {
|
|||
os="$( uname -s )"
|
||||
case "$os"
|
||||
in
|
||||
# Darwin packages are currently not available
|
||||
# ('Darwin')
|
||||
# os='macos'
|
||||
# ;;
|
||||
('Darwin')
|
||||
os='macos'
|
||||
;;
|
||||
('Linux')
|
||||
os='linux'
|
||||
;;
|
||||
|
|
@ -119,7 +118,7 @@ set_os() {
|
|||
# Validate.
|
||||
case "$os"
|
||||
in
|
||||
('linux')
|
||||
('macos'|'linux')
|
||||
# All right, go on.
|
||||
;;
|
||||
(*)
|
||||
|
|
@ -133,6 +132,12 @@ set_os() {
|
|||
|
||||
# Function set_cpu sets the cpu if needed and validates the value.
|
||||
set_cpu() {
|
||||
# For macOS there is a universal binary, so we don't need to set cpu
|
||||
if [ "$os" = 'macos' ]
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Set if needed.
|
||||
if [ "$cpu" = '' ]
|
||||
then
|
||||
|
|
@ -200,7 +205,13 @@ set_is_root() {
|
|||
is_dir_owned_by_current_user() {
|
||||
dir="$1"
|
||||
|
||||
if [ "$os" = "linux" ]; then
|
||||
if [ "$os" = "macos" ]; then
|
||||
# macOS
|
||||
if ! owner_name=$(stat -f '%Su' "$dir"); then
|
||||
echo "Cannot stat '$dir'"
|
||||
return 0
|
||||
fi
|
||||
elif [ "$os" = "linux" ]; then
|
||||
# Linux
|
||||
if ! owner_name=$(stat -c '%U' "$dir"); then
|
||||
echo "Cannot stat '$dir'"
|
||||
|
|
@ -436,7 +447,12 @@ configure() {
|
|||
|
||||
parse_version
|
||||
|
||||
pkg_name="trusttunnel-${os}-${cpu}.${pkg_ext}"
|
||||
if [ "$os" = 'macos' ]
|
||||
then
|
||||
pkg_name="trusttunnel-macos-universal.${pkg_ext}"
|
||||
else
|
||||
pkg_name="trusttunnel-${os}-${cpu}.${pkg_ext}"
|
||||
fi
|
||||
apply_version
|
||||
url="https://github.com/TrustTunnel/TrustTunnel/releases/download/v${version}/${pkg_name}"
|
||||
|
||||
|
|
@ -587,6 +603,12 @@ report_success() {
|
|||
echo " cd ${output_dir}"
|
||||
echo " sudo ./setup_wizard"
|
||||
echo
|
||||
|
||||
if [ "$os" != 'linux' ]
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo "--- Configure systemd service ---"
|
||||
echo
|
||||
echo "The '${output_dir}/trusttunnel.service.template' template"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue