#!/bin/bash if ((${#1} == 0)) ; then echo 'usage: imageinfo.sh userid@system' exit 1 fi ssh $1 '[[ -d /opt/rs9113 ]] && cp -a /opt/rs9113/*.ko /lib/modules/$(uname -r)/extra || depmod -a' echo fetching ipklists d=$(mktemp -d mVerXXXXX) ssh $1 opkg list | sort >$d/ipklist.txt ssh $1 uname -a >$d/drivers.txt drivers=$(ssh $1 lsmod | sed 's/ .*//' | sort) for driver in $drivers ; do if [[ "$driver" == "Module" ]] ; then continue fi { echo echo "$driver" echo "--------------" ssh $1 modinfo $driver | grep -v '^alias:' } >>$d/drivers.txt done scp $1:/etc/mlinux-\* $d cd $d echo "--------------" >>drivers.txt extrad=( "bootstrap 3.5.3-r3" "u-boot-mtcap 2012.10-r6" "uImage 3.12.27-r14.2" ) ((i=0)) while ((i < ${#extrad[@]})) ; do printf "%-15s %-s\n" ${extrad[$i]} >>drivers.txt ((i++)) done zip image_versions.zip *.txt mlinux* echo Zip file is $(pwd)/image_versions.zip