Update chr.sh

Signed-off-by: elseif <elseif@live.cn>
This commit is contained in:
elseif 2025-08-23 05:07:35 +08:00 committed by GitHub
parent 92f26c270e
commit 88ff1f7130
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

3
chr.sh
View file

@ -33,10 +33,11 @@ if LOOP=$(losetup -Pf --show chr.img 2>/dev/null); then
MNT=/tmp/chr
mkdir -p $MNT
if mount ${LOOP}p2 $MNT 2>/dev/null; then
cat <<EOF > $MNT/rw/autorun.scr
cat <<EOF | tee $MNT/rw/autorun.scr
/ip address add address=$ADDRESS interface=ether1
/ip route add gateway=$GATEWAY
EOF
echo "autorun.scr file created."
umount $MNT
else
echo "Failed to mount partition 2, skipping autorun.scr creation."