Skip to content

Commit

Permalink
Usepure shell instead of bash and follow coding conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
gliargovas committed Oct 11, 2023
1 parent 7f30531 commit 48f1454
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions try
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ try() {
while IFS="" read -r mountpoint
do
new_mountpoint=""

OLDIFS=$IFS
IFS=":"

for lower_dir in $LOWER_DIRS
Expand All @@ -79,6 +79,8 @@ try() {
fi
fi
done

IFS=$OLDIFS
# Add the original mountpoint at the end
new_mountpoint="${new_mountpoint:+$new_mountpoint:}$mountpoint"
echo "$new_mountpoint" >> "$UPDATED_DIRS_AND_MOUNTS"
Expand Down Expand Up @@ -181,7 +183,7 @@ fi
# actually mount the overlays
for mountpoint in $(cat "$UPDATED_DIRS_AND_MOUNTS")
do
pure_mountpoint=$(echo "$mountpoint" | awk -F':' '{print $NF}')
pure_mountpoint=${mountpoint##*:}
## We are not interested in mounts that are not directories
if ! [ -d "$pure_mountpoint" ]
Expand All @@ -190,12 +192,11 @@ do
fi
## Don't do anything for the root
## and skip if it is /dev or /proc, we will mount it later
if [ "$pure_mountpoint" = "/" ] ||
[ "$pure_mountpoint" = "/dev" ] || [ "$pure_mountpoint" = "/proc" ]
then
continue
fi
## and skip if it is /dev or /proc, we will mount it later
case "$pure_mountpoint" in
(/|/dev|/proc) continue;;
esac
# Try mounting everything normally
make_overlay "$SANDBOX_DIR" "$mountpoint" "$pure_mountpoint" 2>>"$try_mount_log"
Expand Down

0 comments on commit 48f1454

Please sign in to comment.