Releasing debian version 2.0~a2-1.
[debian-live-boot/hramrach.git] / bin / live-reconfigure
blob16cb51dfa4c35880a4364bc1f9f0c55c7b3591f0
1 #! /bin/sh
3 set -e
5 export PATH=/usr/bin:/usr/sbin:/sbin:/bin
7 frontend=noninteractive
9 findcommandinroot ()
11 ROOT="${1}/"
12 shift
14 while [ "${#}" -ge 1 ]
16 P="${PATH}"
18 while [ "${P}" ]
20 D=${P%%:*}
21 P=${P#*:}
23 if [ "${D}" = "${P}" ]
24 then
28 if [ -z "${D}" ]
29 then
30 D=.
33 if [ -x "${ROOT}${D}/${1}" ]
34 then
35 echo "${D}/${1}"
36 return 0
38 done
40 shift
41 done
43 return 1
46 runcommandinroot ()
48 C=$(findcommandinroot "${1}" "${2}")
49 ROOT="${1}"
51 shift
52 shift
54 [ -n "${C}" ] && chroot "${ROOT}" "${C}" "${@}"
57 root="${1}"
58 package="${2}"
60 version=$(runcommandinroot "${root}" dpkg-query -W --showformat='${Version}' "${package}" 2>/dev/null) || version=""
62 if [ -z "${version}" ]
63 then
64 echo >&2 "${0}: package '${package}' is not installed"
65 exit 0
68 runcommandinroot "${root}" dpkg-reconfigure -fnoninteractive --no-reload "${package}"
70 exit 0