Skip to content

Commit 321541a

Browse files
committed
added a check that fileystem needs expanding before expanding
1 parent 34664ba commit 321541a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

documents/pam.sh

+9-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ if [ -f "$FILE" ]; then
77
else
88
InitialSetup
99
touch "$FILE"
10-
sudo raspi-config --expand-rootfs
10+
11+
#expand the filesystem
12+
PARTSIZE=$( df | sed -n '/root/{s/ */ /gp}' | cut -d ' ' -f2)
13+
THRESHOLD=6291456
14+
if [ "$PARTSIZE" -lt "$THRESHOLD" ]
15+
then
16+
raspi-config --expand-rootfs
17+
fi
1118
sudo shutdown -r now
1219
fi
20+

0 commit comments

Comments
 (0)