Created
December 20, 2018 03:58
-
-
Save BoLaMN/3c7a9b229d2f1aa2e71d279f67b4c9cb to your computer and use it in GitHub Desktop.
dump technicolor router to usb
This file contains 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
#!/bin/sh | |
SOURCE_PATH="/tmp/run/mountd/sda1" | |
exec >> $SOURCE_PATH/update-log.txt 2>&1 | |
echo creating dmesg file | |
dmesg > $SOURCE_PATH/dmesg.txt | |
echo Creating file list | |
ls -lR > $SOURCE_PATH/file-list.txt | |
echo creating system information | |
DAT_NAME="system-info.txt" | |
for i in /proc/*; do | |
echo row $i . | |
if [ -f "$i" ]; then | |
j=`ls -l $i | grep -v "\-\-\-\-\-\-" | grep -v kallsyms` | |
if [ -n "$j" ]; then | |
echo access to: "$i" | |
echo " " >> $SOURCE_PATH/$DAT_NAME | |
echo "Content of $i is: " >> $SOURCE_PATH/$DAT_NAME | |
echo "--------BEGIN--------" >> $SOURCE_PATH/$DAT_NAME | |
cat "$i" >> $SOURCE_PATH/$DAT_NAME | |
echo "--------ENDE---------" >> $SOURCE_PATH/$DAT_NAME | |
echo " " >> $SOURCE_PATH/$DAT_NAME | |
fi | |
fi | |
done | |
echo creating backup tar file | |
cd / | |
tar -cvf $SOURCE_PATH/backup.tar `ls | cat | grep -v proc | grep -v sys` | |
sync | |
cat /proc/partitions >$SOURCE_PATH/partitions.txt | |
cat /proc/mtd >$SOURCE_PATH/mtd.txt | |
cat /proc/cmdline >$SOURCE_PATH/cmdline.txt | |
df -h >$SOURCE_PATH/df.txt | |
dd if=/dev/mtdblock0 of=$SOURCE_PATH/brcmnand.0.img | |
dd if=/dev/mtdblock1 of=$SOURCE_PATH/nand.rootfs.img | |
dd if=/dev/mtdblock2 of=$SOURCE_PATH/nand.rootfs_data.img | |
dd if=/dev/mtdblock3 of=$SOURCE_PATH/bank_1.img | |
dd if=/dev/mtdblock4 of=$SOURCE_PATH/bank_2.img | |
dd if=/dev/mtdblock5 of=$SOURCE_PATH/eripv2.img | |
dd if=/dev/mtdblock6 of=$SOURCE_PATH/rawstorage.img | |
sleep 5 | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment