Skip to content

Commit 246e22a

Browse files
authored
Add files via upload
setup file that works
1 parent cef237a commit 246e22a

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

isetup

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/bin/sh
2+
3+
DISK=0
4+
DISKS=`ls /dev/disk0s1s*`
5+
DISKS=`ls /dev/disk0s1s*`
6+
7+
for i in ${DISKS}
8+
do
9+
LABEL=`/System/Library/Filesystems/apfs.fs/apfs.util -p $i`
10+
if [ "${LABEL}" == "Android" ]; then
11+
DISK=$i
12+
break;
13+
fi
14+
done
15+
if [ ! -b ${DISK} ]; then
16+
newfs_apfs -A -v Android -e /dev/disk0s1
17+
fi
18+
19+
DISK=
20+
DISKS=`ls /dev/disk0s1s*`
21+
22+
for i in ${DISKS}
23+
do
24+
LABEL=`/System/Library/Filesystems/apfs.fs/apfs.util -p $i`
25+
if [ "${LABEL}" == "Android" ]; then
26+
DISK=$i
27+
break;
28+
fi
29+
done
30+
if [ -b ${DISK} ]; then
31+
mkdir -p /tmp/mnt
32+
echo "Mounting ${DISK}"
33+
mount -t apfs ${DISK} /tmp/mnt
34+
if [ $? -ne 0 ]; then
35+
echo "failed to mount disk";
36+
exit 1
37+
fi
38+
rm -rf /tmp/mnt/nand*
39+
echo "Starting to download nand. This will take a few minutes"
40+
wget http://assets.checkra.in/downloads/sandcastle/88b1089d97fe72ab77af8253ab7c312f8e789d49209234239be2408c3ad89a34/nand.gz
41+
if [ $? -ne 0 ]; then
42+
echo "Failed to download nand. Are you connected to wifi?"
43+
umount /tmp/mnt
44+
exit 1;
45+
fi
46+
echo "Decompressing nand image"
47+
mv /var/root/nand.gz /tmp/mnt
48+
gunzip -d /tmp/mnt/nand.gz
49+
if [ $? -ne 0 ]; then
50+
echo "Failed to decompress nand. Wifi disconnected?"
51+
umount /tmp/mnt
52+
exit 1;
53+
fi
54+
sync
55+
umount /tmp/mnt
56+
else
57+
echo "There was an error"
58+
exit 1
59+
fi

0 commit comments

Comments
 (0)