|
131 | 131 | # controlled depth ($targets fuckery) |
132 | 132 | controlled_depth() { |
133 | 133 | if [ -z "$1" ] || [ -z "$2" ]; then return ; fi |
| 134 | + mount_success=0 |
134 | 135 | for DIR in $(ls -d $1/*/ | sed 's/.$//' ); do |
135 | 136 | if [ "$decoy_mount_enabled" = "1" ] && [ -w "$DECOY_MOUNT_FOLDER" ]; then |
136 | 137 | mkdir -p "$DECOY_MOUNT_FOLDER/$2$DIR" |
137 | | - busybox mount -t "$FS_TYPE_ALIAS" -o "lowerdir=$DECOY_MOUNT_FOLDER$2$DIR:$(pwd)/$DIR:$2$DIR" "$MOUNT_DEVICE_NAME" "$2$DIR" |
| 138 | + busybox mount -t "$FS_TYPE_ALIAS" -o "lowerdir=$DECOY_MOUNT_FOLDER$2$DIR:$(pwd)/$DIR:$2$DIR" "$MOUNT_DEVICE_NAME" "$2$DIR" && mount_success=1 |
138 | 139 | else |
139 | | - busybox mount -t "$FS_TYPE_ALIAS" -o "lowerdir=$(pwd)/$DIR:$2$DIR" "$MOUNT_DEVICE_NAME" "$2$DIR" |
| 140 | + busybox mount -t "$FS_TYPE_ALIAS" -o "lowerdir=$(pwd)/$DIR:$2$DIR" "$MOUNT_DEVICE_NAME" "$2$DIR" && mount_success=1 |
140 | 141 | fi |
141 | | - echo "$2$DIR" >> "$LOG_FOLDER/mountify_mount_list" |
| 142 | + [ "$mount_success" = 1 ] && echo "$2$DIR" >> "$LOG_FOLDER/mountify_mount_list" |
142 | 143 | done |
143 | 144 | } |
144 | 145 |
|
145 | 146 | # handle single depth (/system/bin, /system/etc, et. al) |
146 | 147 | single_depth() { |
| 148 | + mount_success=0 |
147 | 149 | for DIR in $( ls -d */ | sed 's/.$//' | grep -vE "^(odm|product|system_ext|vendor)$" 2>/dev/null ); do |
148 | 150 | if [ "$decoy_mount_enabled" = "1" ] && [ -w "$DECOY_MOUNT_FOLDER" ]; then |
149 | 151 | mkdir -p "$DECOY_MOUNT_FOLDER/system/$DIR" |
150 | | - busybox mount -t "$FS_TYPE_ALIAS" -o "lowerdir=$DECOY_MOUNT_FOLDER/system/$DIR:$(pwd)/$DIR:/system/$DIR" "$MOUNT_DEVICE_NAME" "/system/$DIR" |
| 152 | + busybox mount -t "$FS_TYPE_ALIAS" -o "lowerdir=$DECOY_MOUNT_FOLDER/system/$DIR:$(pwd)/$DIR:/system/$DIR" "$MOUNT_DEVICE_NAME" "/system/$DIR" && mount_success=1 |
151 | 153 | else |
152 | | - busybox mount -t "$FS_TYPE_ALIAS" -o "lowerdir=$(pwd)/$DIR:/system/$DIR" "$MOUNT_DEVICE_NAME" "/system/$DIR" |
| 154 | + busybox mount -t "$FS_TYPE_ALIAS" -o "lowerdir=$(pwd)/$DIR:/system/$DIR" "$MOUNT_DEVICE_NAME" "/system/$DIR" && mount_success=1 |
153 | 155 | fi |
154 | | - echo "/system/$DIR" >> "$LOG_FOLDER/mountify_mount_list" |
| 156 | + [ "$mount_success" = 1 ] && echo "/system/$DIR" >> "$LOG_FOLDER/mountify_mount_list" |
155 | 157 | done |
156 | 158 | } |
157 | 159 |
|
|
0 commit comments