Bump to Macproxy release 21.12.1 (#509)

* Bump Macproxy version to 21.12.1

* Add functions for starting and stopping macproxy service; rename start script

* Remove superfluous step

* Fix bugs
This commit is contained in:
Daniel Markstedt 2021-12-06 18:41:46 -08:00 committed by GitHub
parent 0cc0ee9094
commit 824a9c5ecd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -317,6 +317,13 @@ function stopRaScsiScreen() {
fi
}
# Stops the macproxy service if it is running
function stopMacproxy() {
if [ -f "$SYSTEMD_PATH/macproxy.service" ]; then
sudo systemctl stop macproxy.service
fi
}
# Starts the monitor_rascsi service if installed
function startRaScsiScreen() {
if [ -f "$SYSTEMD_PATH/monitor_rascsi.service" ]; then
@ -325,6 +332,14 @@ function startRaScsiScreen() {
fi
}
# Starts the macproxy service if installed
function startMacproxy() {
if [ -f "$SYSTEMD_PATH/macproxy.service" ]; then
sudo systemctl start macproxy.service
showMacproxyStatus
fi
}
# Shows status for the rascsi service
function showRaScsiStatus() {
systemctl status rascsi | tee
@ -340,6 +355,11 @@ function showRaScsiScreenStatus() {
systemctl status monitor_rascsi | tee
}
# Shows status for the macproxy service
function showMacproxyStatus() {
systemctl status macproxy | tee
}
# Creates a drive image file with specific parameters
function createDrive600MB() {
createDrive 600 "HD600"
@ -672,23 +692,23 @@ function installMacproxy {
( sudo apt-get update && sudo apt-get install python3 python3-venv --assume-yes ) </dev/null
MACPROXY_VER="21.11"
MACPROXY_VER="21.12.1"
MACPROXY_PATH="$HOME/macproxy-$MACPROXY_VER"
if [ -d "$MACPROXY_PATH" ]; then
echo "The $MACPROXY_PATH directory already exists. Delete it to proceed with the installation."
exit 1
fi
cd "$HOME" || exit 1
wget -O "macproxy-$MACPROXY_VER.tar.gz" "https://github.com/rdmark/macproxy/archive/refs/tags/v$MACPROXY_VER.tar.gz" </dev/null
wget -O "macproxy-$MACPROXY_VER.tar.gz" "https://github.com/rdmark/macproxy/archive/refs/tags/$MACPROXY_VER.tar.gz" </dev/null
tar -xzvf "macproxy-$MACPROXY_VER.tar.gz"
cd "$MACPROXY_PATH" || exit 1
stopMacproxy
sudo cp "$MACPROXY_PATH/macproxy.service" "$SYSTEMD_PATH"
sudo sed -i /^ExecStart=/d "$SYSTEMD_PATH/macproxy.service"
sudo sed -i "8 i ExecStart=$MACPROXY_PATH/start.sh" "$SYSTEMD_PATH/macproxy.service"
sudo sed -i "8 i ExecStart=$MACPROXY_PATH/start_macproxy.sh" "$SYSTEMD_PATH/macproxy.service"
sudo systemctl daemon-reload
sudo systemctl enable macproxy
sudo systemctl start macproxy
sudo systemctl status macproxy
startMacproxy
echo -n "Macproxy is now running on IP "
echo -n `ip -4 addr show scope global | grep -oP '(?<=inet\s)\d+(\.\d+){3}'`