Created
January 8, 2018 10:43
-
-
Save hamishcoleman/75de3d6c5040efccf392f984306ea2c2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See if there is any config to restore | |
try_dev() { | |
echo mknod /dev/$1 b $2 $3 | |
# mount /dev/$1 /mnt -o ro | |
# next if error | |
# for j in $mnt/conf.d/*.tar.gz | |
# tar xf $j etc | |
# for j in $mnt/conf.d/*.sh | |
# source $j | |
# umount /mnt | |
} | |
mount -t proc proc /proc | |
cat /proc/partitions | while read major minor size name x; do | |
case $name in | |
sd*[0-9]|mmcblk*p*) | |
echo Checking for config files on $name | |
try_dev $name $major $minor | |
;; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment