Update chr_busybox.sh

Signed-off-by: elseif <elseif@live.cn>
This commit is contained in:
elseif 2025-08-23 04:11:51 +08:00 committed by GitHub
parent 49608606f2
commit 6a486adfc6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -21,21 +21,21 @@ echo "ADDRESS is $ADDRESS"
GATEWAY=$(ip route list | grep default | cut -d' ' -f 3) GATEWAY=$(ip route list | grep default | cut -d' ' -f 3)
echo "GATEWAY is $GATEWAY" echo "GATEWAY is $GATEWAY"
LOOP=$(losetup -Pf --show chr.img) #LOOP=$(losetup -Pf --show chr.img)
echo "LOOP device is $LOOP" #echo "LOOP device is $LOOP"
sleep 3 sleep 3
MNT=/mnt/chr #MNT=/mnt/chr
mkdir -p $MNT #mkdir -p $MNT
mount ${LOOP}p2 $MNT #mount ${LOOP}p2 $MNT
cat <<EOF | tee $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
umount $MNT #umount $MNT
losetup -d $LOOP #losetup -d $LOOP
echo "WARNING: All data on /dev/$STORAGE will be lost!" echo "WARNING: All data on /dev/$STORAGE will be lost!"
read -p "Do you want to continue? [Y/n]: " confirm read -p "Do you want to continue? [Y/n]: " confirm