Skip to content

Commit

Permalink
0.11-rc2
Browse files Browse the repository at this point in the history
  • Loading branch information
cinnamonwolfy committed Dec 8, 2023
1 parent b23e022 commit 82bc2bd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
17 changes: 12 additions & 5 deletions pl-files/pl-rootfs/usr-bin/automount
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ end_loop=""

virt_printf(){
if [ "$silent" = "no-silent" ]; then
printf $@
printf "$1"
fi
}

virt_echo(){
if [ "$silent" = "no-silent" ]; then
echo $@
echo "$1"
fi
}

Expand All @@ -22,21 +22,28 @@ main_prog(){
else
virt_echo "Found devices"
for device in $(blkid | cut -d: -f1); do
for i in $(seq 6); do
for i in $(seq $(expr $(blkid | grep $device | grep -o ' ' | wc -l) + 1)); do
if [ $(blkid | grep $device | cut -d' ' -f$i | grep TYPE -c) -gt 0 ]; then
filesystem="$(blkid | grep $device | cut -d' ' -f$i | cut -d= -f2 | grep -ov \")"
virt_printf "* Mounting $device ($filesystem)..."
if [ ! -d /mnt/$(basename $device) ]; then
if [ ! -d "/mnt/$(basename $device)" ]; then
mkdir /mnt/$(basename $device)
mount $device -t $filesystem -o ro /mnt/$(basename $device)
mount "$device" -t "$filesystem" -o ro "/mnt/$(basename $device)"
virt_echo "Done."
break
else
virt_echo "Already Mounted."
fi
fi
done
done
fi

for folder in $(ls /mnt); do
if [ $(ls /dev | grep -c "/dev/$folder") -eq 0 ]; then
rmdir /mnt/$folder
fi
done
}

silent="$1"
Expand Down
2 changes: 1 addition & 1 deletion pl-files/pl-rootfs/usr-bin/ls
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
args=$@
if [ $(echo "$@" | grep -c "--color") -eq 0 ]; then
if [ "$(echo '$@' | grep -c '\--color')" -eq 0 ]; then
args="--color=auto $args"
fi

Expand Down

0 comments on commit 82bc2bd

Please sign in to comment.