Skip to content

Commit

Permalink
Enhance from=ask
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas-M committed Sep 29, 2023
1 parent 0da7e0e commit 5ddf9ac
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion livekitlib
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,18 @@ find_data()

# If user wants to get asked, ask and periodically update list of devices
if [ "$FROM" = "ask" ]; then
(while true; do blkid -o full -s TYPE -s LABEL | grep -E -v "/loop|/ram|/zram" >/tmp/0.txt; mv -f /tmp/0.txt /tmp/ask.txt; sleep 1; done) &
(
while true; do
blkid -o full -s TYPE -s LABEL | grep -E -v "/loop|/ram|/zram|swap" | while read LINE; do
DISK="$(echo "$LINE" | cut -d : -f 1)"
SIZE="$(fdisk -l "$DISK" 2>/dev/null | grep $DISK | grep : | sed -r "s/.*: |,.*//g")"
echo -n "$DISK: $SIZE, "
echo "$LINE" | sed -r 's/[^"]*"([^"]*)"/\1, /g' | sed -r 's/, $//'
done >/tmp/0.txt
mv -f /tmp/0.txt /tmp/ask.txt
sleep 1
done
) &
ASKPID=$!
sleep 1 # give blkid some chance to finish
FROM="$(ncurses-menu -t "Look for /$LIVEKITNAME/ directory on:" -f /tmp/ask.txt -s 2>&1 >/dev/tty1 < /dev/tty1)"
Expand Down

0 comments on commit 5ddf9ac

Please sign in to comment.