#!/bin/busybox ash # (c) Robert Shingledecker 2011 # Use exit code to get Windows partition if any. # exit code of 0 means none found. . /etc/init.d/tc-functions useBusybox PARTNO="$(fdisk -l 2>/dev/null | grep "^/dev/$1" | awk ' { type = substr($0,52,2) if (type == " 7" || type == " c") { results = substr($1,9) print results } } ' )" [ -z "$PARTNO" ] && PARTNO="0" return "$PARTNO"