From 305a4b4cd968a25bd7d429be61b90e3da0c2fd78 Mon Sep 17 00:00:00 2001 From: DesktopECHO <33142753+DesktopECHO@users.noreply.github.com> Date: Sat, 14 May 2022 23:11:20 -0230 Subject: [PATCH 1/2] Update --- bin/ncp-diag | 11 +++++++++-- etc/library.sh | 12 +++++++++--- lamp.sh | 5 +++++ 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/bin/ncp-diag b/bin/ncp-diag index bed4cfe43..a34c8097e 100644 --- a/bin/ncp-diag +++ b/bin/ncp-diag @@ -87,8 +87,15 @@ echo "port check 80|$( is_port_open 80 )" echo "port check 443|$( is_port_open 443 )" # LAN -IFACE=$( ip r | grep "default via" | awk '{ print $5 }' | head -1 ) -GW=$( ip r | grep "default via" | awk '{ print $3 }' | head -1 ) + if [ ! -e /usr/sbin/unchroot ]; then + ## Standard Install + IFACE=$( ip r | grep "default via" | awk '{ print $5 }' | head -1 ) + GW=$( ip r | grep "default via" | awk '{ print $3 }' | head -1 ) + else + ## Android Container + IFACE=$( ip r | awk '{ print $3 }' | head -1 ) + GW=$( ip r get 9.9.9.9 | grep "via" | awk '{ print $3 }' | head -1 ) + fi IP="$(get_ip)" echo "IP|$IP" diff --git a/etc/library.sh b/etc/library.sh index b0ee48986..8c678d851 100644 --- a/etc/library.sh +++ b/etc/library.sh @@ -417,9 +417,15 @@ function nc_version() function get_ip() { - local iface - iface="$( ip r | grep "default via" | awk '{ print $5 }' | head -1 )" - ip a show dev "$iface" | grep global | grep -oP '\d{1,3}(.\d{1,3}){3}' | head -1 + if [ ! -e /usr/sbin/unchroot ]; then + ## Standard Install + local iface + iface="$( ip r | grep "default via" | awk '{ print $5 }' | head -1 )" + ip a show dev "$iface" | grep global | grep -oP '\d{1,3}(.\d{1,3}){3}' | head -1 + else + ## Android Container + (ip -o route get to 9.9.9.9 | sed -n 's/.*src \([0-9.]\+\).*/\1/p') + fi } function is_an_ip() diff --git a/lamp.sh b/lamp.sh index d62c49965..ef6be1637 100644 --- a/lamp.sh +++ b/lamp.sh @@ -34,6 +34,11 @@ install() mkdir -p /run/php + ## Android containers need to explicitly set Mutex file + if [ ! -e /usr/sbin/unchroot ]; then + echo "Mutex file:${APACHE_LOCK_DIR} default" >> /etc/apache2/apache2.conf + fi + # mariaDB password local DBPASSWD="default" echo -e "[client]\npassword=$DBPASSWD" > /root/.my.cnf From dd6ec1ae5d2599e3976369eafe4c974aed3d4b5a Mon Sep 17 00:00:00 2001 From: DesktopECHO <33142753+DesktopECHO@users.noreply.github.com> Date: Sun, 15 May 2022 17:57:50 -0230 Subject: [PATCH 2/2] Update lamp.sh --- lamp.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lamp.sh b/lamp.sh index ef6be1637..a884f12e2 100644 --- a/lamp.sh +++ b/lamp.sh @@ -34,11 +34,9 @@ install() mkdir -p /run/php - ## Android containers need to explicitly set Mutex file - if [ ! -e /usr/sbin/unchroot ]; then - echo "Mutex file:${APACHE_LOCK_DIR} default" >> /etc/apache2/apache2.conf - fi - + ## Android container needs to explicitly set this Apache default + [ -e /usr/sbin/unchroot ] && sed -i 's/#Mutex file:${APACHE_LOCK_DIR} default/Mutex file:${APACHE_LOCK_DIR} default/g' /etc/apache2/apache2.conf + # mariaDB password local DBPASSWD="default" echo -e "[client]\npassword=$DBPASSWD" > /root/.my.cnf