Skip to content

Commit

Permalink
Fix Shell when multiple carts are present.
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnnyonFlame committed Mar 7, 2023
1 parent 7c9811c commit f313d75
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions redist/shell/special/shell.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#!/bin/sh -x

#!/bin/bash -e
DROPBEAR_ID="/mnt/sdcard/tools/.id_dropbear"
AVAHI_CONF="/mnt/sdcard/tools/avahi-daemon.conf"
MOUNT_SDCARD=$(mount | grep -r '^/dev/.* on /mnt/sdcard' | cut -d ' ' -f1)

# jank fix for permissions...
umount "${MOUNT_SDCARD}"
mount -o rw,umask=000,noatime,nodiratime "${MOUNT_SDCARD}" /mnt/sdcard
for i in /mnt/*; do
DEVNAME=$(mountpoint -n "$i" | cut -d ' ' -f1)
FSTYPE=$(mount | grep "^$DEVNAME on " | cut -d ' ' -f5)
# Ignore non-fat filesystems
[[ "$FSTYPE" == "vfat" ]] || continue

# Remount with umask=000, so everything always have executable flags
umount "$i"
mount -o rw,umask=000,noatime,nodiratime "${DEVNAME}" "$i"
done

# Setup
ln -s /mnt/sdcard/tools/dropbearmulti /tmp/scp
Expand Down

0 comments on commit f313d75

Please sign in to comment.