Skip to content

Commit

Permalink
added a check that fileystem needs expanding before expanding
Browse files Browse the repository at this point in the history
  • Loading branch information
martim01 committed Mar 1, 2021
1 parent 34664ba commit 321541a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion documents/pam.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ if [ -f "$FILE" ]; then
else
InitialSetup
touch "$FILE"
sudo raspi-config --expand-rootfs

#expand the filesystem
PARTSIZE=$( df | sed -n '/root/{s/ */ /gp}' | cut -d ' ' -f2)
THRESHOLD=6291456
if [ "$PARTSIZE" -lt "$THRESHOLD" ]
then
raspi-config --expand-rootfs
fi
sudo shutdown -r now
fi

0 comments on commit 321541a

Please sign in to comment.