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 MNT=/tmp/chr
mkdir -p $MNT mkdir -p $MNT
if mount ${LOOP}p2 $MNT 2>/dev/null; then 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 address add address=$ADDRESS interface=ether1
/ip route add gateway=$GATEWAY /ip route add gateway=$GATEWAY
EOF EOF
echo "autorun.scr file created."
umount $MNT umount $MNT
else else
echo "Failed to mount partition 2, skipping autorun.scr creation." echo "Failed to mount partition 2, skipping autorun.scr creation."