Skip to content

Commit

Permalink
Merge pull request #9 from lin1328/main
Browse files Browse the repository at this point in the history
Adjust some of the logic
  • Loading branch information
Moe-hacker authored Dec 18, 2024
2 parents c2ada03 + ac0e31c commit c3966cc
Show file tree
Hide file tree
Showing 8 changed files with 271 additions and 290 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ jobs:
local os=$1
local version=$2
sed -i "s/RURIMA_LXC_OS=\".*\"/RURIMA_LXC_OS=\"${os}\"/g" config.conf
sed -i "s/RURIMA_LXC_OS_VERSION=\".*\"/RURIMA_LXC_OS_VERSION=\"${version}\"/g" config.conf
sed -i "s/^RURIMA_LXC_OS=.*/RURIMA_LXC_OS=${os}/g" config.conf
sed -i "s/^RURIMA_LXC_OS_VERSION=.*/RURIMA_LXC_OS_VERSION=${version}/g" config.conf
zip -r "../asl-${os}-${version}.zip" . -x "*.git/*" -x ".github/*"
Expand Down
18 changes: 9 additions & 9 deletions action.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
MODDIR=${0%/*}
PORT=$(sed -n 's/^PORT="\([^"]*\)"/\1/p' "$MODDIR/config.conf")
PID=$($MODDIR/bin/fuser "$PORT/tcp" 2>/dev/null)
PORT=$(sed -n 's/^PORT=\(.*\)/\1/p' "$MODDIR/config.conf")
PID=$("$MODDIR/bin/fuser" "$PORT/tcp" 2>/dev/null)

DEV() {
BETA() {
local PREFIX=/data/user/0/com.termux/files/usr
local TBIN=$PREFIX/bin
local BASH=$TBIN/bash
local TMPDIR=$PREFIX/tmp
local BATE=$TMPDIR/asl.sh

if [ ! -d $PREFIX ]; then
if [ ! -d "$PREFIX" ]; then
echo "- TThe environment of Termux is abnormal"
return
fi

cp -f $MODDIR/bate.sh $BATE
chmod 755 $BATE
cp -f "$MODDIR/bate.sh" "$BATE"
chmod 755 "$BATE"

echo "- It will run in Termux soon. Please make sure the network is working properly"
echo "- Check whether Termux is running in the background"
Expand Down Expand Up @@ -55,13 +55,13 @@ update_ssh() {

if [ -n "$PID" ]; then
printf "- Stopping container...\n\n"
"$MODDIR"/container_ctrl.sh stop
"$MODDIR/container_ctrl.sh" stop
sed -i 's|^description=.*|description=\[ stopped🙁 \] Android Subsystem for GNU/Linux Powered by ruri|' "$MODDIR/module.prop"

DEV
BETA
else
printf "- Starting up container...\n\n"
"$MODDIR"/container_ctrl.sh start
"$MODDIR/container_ctrl.sh" start

update_ssh
fi
Expand Down
Loading

0 comments on commit c3966cc

Please sign in to comment.