From 846297f477f1989cb06b57c82445595c92de9212 Mon Sep 17 00:00:00 2001 From: Steven Burnham Date: Wed, 15 Nov 2023 22:01:07 -0500 Subject: [PATCH] added macos/linux check and OS specifics --- unix_installer.sh | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/unix_installer.sh b/unix_installer.sh index 2cfa60e..e1b6b63 100644 --- a/unix_installer.sh +++ b/unix_installer.sh @@ -1,32 +1,54 @@ #!/bin/bash +set -o +set -x +set -u + +OS_NAME=$(uname -s) + +if [[ "$OS_NAME" == "Darwin" ]]; then + echo "The operating system is macOS." + if command -v brew >/dev/null 2>&1; then + echo "Homebrew is already installed." + else + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + fi + brew install cmake + brew install pkgconfig +elif [[ "$OS_NAME" == "Linux" ]]; then + echo "The operating system is Linux." +else + echo "Unknown operating system: $OS_NAME" +fi + +# Create a virtual environment mkdir -p ~/.venv -python3.10 -m pypush ~/.venv +python3.10 -m venv ~/.venv/pypush source ~/.venv/pypush/bin/activate # Clone the repo +cd ~ git clone -b sms-registration https://github.com/beeper/pypush cd pypush -# Change directories to the repository. -cd ~/pypush - # Prompt the user for the IP address of their phone. -read -p "Enter the IP address of your phone: " phoneIp +read -p "Enter the IP address of your phone: " PHONEIP # Execute the `python demo.py` script with the phone IP address passed as a parameter. -python demo.py --phone $phoneIp +python demo.py --phone $PHONEIP # Create a reregistration script cat > reregister.sh <> /dev/null 2&>1"; } | crontab - \ No newline at end of file