mirror of
https://github.com/RasppleII/a2server.git
synced 2024-12-22 02:30:04 +00:00
Add beta run-local support for development
This commit is contained in:
parent
ee4078ab23
commit
94d17f56cc
0
.a2server_source
Normal file
0
.a2server_source
Normal file
@ -11,10 +11,19 @@
|
|||||||
|
|
||||||
a2serverVersion="1.5.1"
|
a2serverVersion="1.5.1"
|
||||||
|
|
||||||
|
a2server_devel="$( dirname "${BASH_SOURCE[0]}" )/.."
|
||||||
|
if [[ -f "$a2server_devel/.a2server_source" ]]; then
|
||||||
|
pushd $a2server_devel >/dev/null
|
||||||
|
a2server_devel="$PWD"
|
||||||
|
popd >/dev/null
|
||||||
|
else
|
||||||
|
a2server_devel=
|
||||||
|
fi
|
||||||
|
|
||||||
# Ensure URL we'll use ends in a /
|
# Ensure URL we'll use ends in a /
|
||||||
case "$A2SERVER_SCRIPT_URL" in
|
case "$A2SERVER_SCRIPT_URL" in
|
||||||
*/) scriptURL="$A2SERVER_SCRIPT_URL" ;;
|
*/) scriptURL="$A2SERVER_SCRIPT_URL" ;;
|
||||||
*) scriptURL="${A2SERVER_SCRIPT_URL:-https://raw.githubusercontent.com/RasppleII/a2server/current}/" ;;
|
*) scriptURL="${A2SERVER_SCRIPT_URL:-https://raw.githubusercontent.com/RasppleII/a2server/release}/" ;;
|
||||||
esac
|
esac
|
||||||
case "$A2SERVER_BINARY_URL" in
|
case "$A2SERVER_BINARY_URL" in
|
||||||
*/) binaryURL="$A2SERVER_BINARY_URL" ;;
|
*/) binaryURL="$A2SERVER_BINARY_URL" ;;
|
||||||
@ -200,6 +209,10 @@ if (( $doSetup )); then
|
|||||||
|
|
||||||
if (( $doSetup )); then
|
if (( $doSetup )); then
|
||||||
|
|
||||||
|
origDir="$PWD"
|
||||||
|
rm -rf /tmp/a2server-install &>/dev/null
|
||||||
|
mkdir -p /tmp/a2server-install
|
||||||
|
|
||||||
isApple2Pw=
|
isApple2Pw=
|
||||||
isRaspberryPw=
|
isRaspberryPw=
|
||||||
userPw=$(sudo grep "^$USER" /etc/shadow | cut -f 2 -d ':')
|
userPw=$(sudo grep "^$USER" /etc/shadow | cut -f 2 -d ':')
|
||||||
@ -237,49 +250,46 @@ if (( $doSetup )); then
|
|||||||
echo
|
echo
|
||||||
echo "A2SERVER: Downloading scripts..."
|
echo "A2SERVER: Downloading scripts..."
|
||||||
|
|
||||||
wget -q -O /tmp/1.storage "${scriptURL}scripts/a2server-1-storage.txt"
|
read -d '' a2serverSubScripts <<-EOF
|
||||||
chmod ugo+x /tmp/1.storage
|
a2server-1-storage.txt
|
||||||
|
a2server-2-tools.txt
|
||||||
|
a2server-3-sharing.txt
|
||||||
|
a2server-5-netboot.txt
|
||||||
|
a2server-6-samba.txt
|
||||||
|
a2server-7-console.txt
|
||||||
|
EOF
|
||||||
|
|
||||||
wget -q -O /tmp/2.tools "${scriptURL}scripts/a2server-2-tools.txt"
|
if [[ -z "$a2server_devel" ]]; then
|
||||||
chmod ugo+x /tmp/2.tools
|
for _script in $a2serverSubScripts; do
|
||||||
|
wget -q -O "/tmp/a2server-install/$_script" "${scriptURL}scripts/$_script"
|
||||||
|
chmod ugo+x "/tmp/a2server-install/$_script"
|
||||||
|
done
|
||||||
|
|
||||||
wget -q -O /tmp/3.sharing "${scriptURL}scripts/a2server-3-sharing.txt"
|
echo "A2SERVER: Scripts have been downloaded. Installing..."
|
||||||
chmod ugo+x /tmp/3.sharing
|
|
||||||
|
|
||||||
wget -q -O /tmp/5.netboot "${scriptURL}scripts/a2server-5-netboot.txt"
|
if [[ $installAll ]]; then
|
||||||
chmod ugo+x /tmp/5.netboot
|
sudo rm -f /usr/local/etc/A2SERVER-version /usr/local/bin/nulib2 /usr/local/bin/unar /usr/local/sbin/macipgw /usr/local/bin/ciopfs /usr/local/etc/netatalk/afppasswd /usr/local/etc/netatalk/a2boot/p8 /usr/local/etc/netatalk/a2boot/ProDOS16\ Image
|
||||||
|
fi
|
||||||
|
|
||||||
wget -q -O /tmp/6.samba "${scriptURL}scripts/a2server-6-samba.txt"
|
for _script in $a2serverSubScripts; do
|
||||||
chmod ugo+x /tmp/6.samba
|
"/tmp/a2server-install/$_script"
|
||||||
|
done
|
||||||
|
for _script in $a2serverSubScripts; do
|
||||||
|
rm -f "/tmp/a2server-install/$_script"
|
||||||
|
done
|
||||||
|
|
||||||
wget -q -O /tmp/7.console "${scriptURL}scripts/a2server-7-console.txt"
|
else
|
||||||
chmod ugo+x /tmp/7.console
|
# Local development scripts just run them
|
||||||
|
if [[ $installAll ]]; then
|
||||||
|
sudo rm -f /usr/local/etc/A2SERVER-version /usr/local/bin/nulib2 /usr/local/bin/unar /usr/local/sbin/macipgw /usr/local/bin/ciopfs /usr/local/etc/netatalk/afppasswd /usr/local/etc/netatalk/a2boot/p8 /usr/local/etc/netatalk/a2boot/ProDOS16\ Image
|
||||||
|
fi
|
||||||
|
|
||||||
echo "A2SERVER: Scripts have been downloaded. Installing..."
|
for _script in $a2serverSubScripts; do
|
||||||
|
"$a2server_devel/scripts/$_script"
|
||||||
if [[ $installAll ]]; then
|
done
|
||||||
sudo rm /usr/local/etc/A2SERVER-version 2> /dev/null
|
|
||||||
sudo rm /usr/local/bin/nulib2 2> /dev/null
|
|
||||||
sudo rm /usr/local/bin/unar 2> /dev/null
|
|
||||||
sudo rm /usr/local/sbin/macipgw 2> /dev/null
|
|
||||||
sudo rm /usr/local/bin/ciopfs 2> /dev/null
|
|
||||||
sudo rm /usr/local/etc/netatalk/afppasswd 2> /dev/null
|
|
||||||
sudo rm /usr/local/etc/netatalk/a2boot/p8 /usr/local/etc/netatalk/a2boot/ProDOS16\ Image 2> /dev/null
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
/tmp/1.storage
|
rm -f /tmp/a2server-packageReposUpdated
|
||||||
rm /tmp/1.storage
|
|
||||||
/tmp/2.tools
|
|
||||||
rm /tmp/2.tools
|
|
||||||
/tmp/3.sharing
|
|
||||||
rm /tmp/3.sharing
|
|
||||||
/tmp/5.netboot
|
|
||||||
rm /tmp/5.netboot
|
|
||||||
/tmp/6.samba
|
|
||||||
rm /tmp/6.samba
|
|
||||||
/tmp/7.console
|
|
||||||
rm /tmp/7.console
|
|
||||||
rm /tmp/a2server-packageReposUpdated &> /dev/null
|
|
||||||
|
|
||||||
if [[ ! -f /usr/local/etc/A2SERVER-version ]] \
|
if [[ ! -f /usr/local/etc/A2SERVER-version ]] \
|
||||||
|| (( $(head -c 3 /usr/local/etc/A2SERVER-version) < ${a2serverVersion:0:3} )); then
|
|| (( $(head -c 3 /usr/local/etc/A2SERVER-version) < ${a2serverVersion:0:3} )); then
|
||||||
@ -384,5 +394,6 @@ fi
|
|||||||
|
|
||||||
unset a2server_update 2> /dev/null
|
unset a2server_update 2> /dev/null
|
||||||
unset doSetup 2> /dev/null
|
unset doSetup 2> /dev/null
|
||||||
|
rm -rf /tmp/a2server-install &>/dev/null
|
||||||
rm -f /tmp/a2server-* 2> /dev/null
|
rm -f /tmp/a2server-* 2> /dev/null
|
||||||
rm -f setup &> /dev/null
|
rm -f setup &> /dev/null
|
||||||
|
@ -1,6 +1,15 @@
|
|||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
# vim: set tabstop=4 shiftwidth=4 noexpandtab filetype=sh:
|
# vim: set tabstop=4 shiftwidth=4 noexpandtab filetype=sh:
|
||||||
|
|
||||||
|
a2server_devel="$( dirname "${BASH_SOURCE[0]}" )/.."
|
||||||
|
if [[ -f "$a2server_devel/.a2server_source" ]]; then
|
||||||
|
pushd $a2server_devel >/dev/null
|
||||||
|
a2server_devel="$PWD"
|
||||||
|
popd >/dev/null
|
||||||
|
else
|
||||||
|
a2server_devel=
|
||||||
|
fi
|
||||||
|
|
||||||
# Ensure URL we'll use ends in a /
|
# Ensure URL we'll use ends in a /
|
||||||
case "$A2SERVER_SCRIPT_URL" in
|
case "$A2SERVER_SCRIPT_URL" in
|
||||||
*/) scriptURL="$A2SERVER_SCRIPT_URL" ;;
|
*/) scriptURL="$A2SERVER_SCRIPT_URL" ;;
|
||||||
|
Loading…
Reference in New Issue
Block a user