summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-09-24 09:45:11 +0200
committerDaniel Baumann <daniel@debian.org>2011-03-09 17:31:05 +0100
commitcc62ca76356dc851006e3fc980cc1dcc46ef9ca6 (patch)
treee821a640df8121aaea6e02e814c6a82bc75bac46 /bin
parent32e6d9c217846ec5f6d2da9b773a34c4d1970348 (diff)
downloadlive-boot-cc62ca76356dc851006e3fc980cc1dcc46ef9ca6.tar.gz
live-boot-cc62ca76356dc851006e3fc980cc1dcc46ef9ca6.zip
Consistently using curly brackets for variables.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/live-preseed20
-rwxr-xr-xbin/live-reconfigure34
-rwxr-xr-xbin/live-snapshot38
3 files changed, 46 insertions, 46 deletions
diff --git a/bin/live-preseed b/bin/live-preseed
index 3bdd8ce..36154ea 100755
--- a/bin/live-preseed
+++ b/bin/live-preseed
@@ -4,20 +4,20 @@ set -e
PATH=/usr/sbin:/usr/bin:/sbin:/bin
-root="$1"
-question="$2"
-value="$3"
-seen="$4"
+root="${1}"
+question="${2}"
+value="${3}"
+seen="${4}"
-[ "$seen" ] || seen=true
+[ "${seen}" ] || seen=true
-if ! (echo "SET $question $value"; echo "FSET $question seen $seen") | chroot "$1" debconf-communicate -fnoninteractive live-initramfs >/dev/null
+if ! (echo "SET ${question} ${value}"; echo "FSET ${question} seen ${seen}") | chroot "${1}" debconf-communicate -fnoninteractive live-initramfs >/dev/null
then
-chroot "$1" debconf-communicate -fnoninteractive live-initramfs >/dev/null << EOF
-REGISTER debian-installer/dummy $question
-SET $question $value
-FSET $question seen $seen
+chroot "${1}" debconf-communicate -fnoninteractive live-initramfs >/dev/null << EOF
+REGISTER debian-installer/dummy ${question}
+SET ${question} ${value}
+FSET ${question} seen ${seen}
EOF
fi
diff --git a/bin/live-reconfigure b/bin/live-reconfigure
index 565bdea..16cb51d 100755
--- a/bin/live-reconfigure
+++ b/bin/live-reconfigure
@@ -8,31 +8,31 @@ frontend=noninteractive
findcommandinroot ()
{
- ROOT="$1/"
+ ROOT="${1}/"
shift
- while [ "$#" -ge 1 ]
+ while [ "${#}" -ge 1 ]
do
- P="$PATH"
+ P="${PATH}"
- while [ "$P" ]
+ while [ "${P}" ]
do
D=${P%%:*}
P=${P#*:}
- if [ "$D" = "$P" ]
+ if [ "${D}" = "${P}" ]
then
P=
fi
- if [ -z "$D" ]
+ if [ -z "${D}" ]
then
D=.
fi
- if [ -x "$ROOT$D/$1" ]
+ if [ -x "${ROOT}${D}/${1}" ]
then
- echo "$D/$1"
+ echo "${D}/${1}"
return 0
fi
done
@@ -45,26 +45,26 @@ findcommandinroot ()
runcommandinroot ()
{
- C=$(findcommandinroot "$1" "$2")
- ROOT="$1"
+ C=$(findcommandinroot "${1}" "${2}")
+ ROOT="${1}"
shift
shift
- [ -n "$C" ] && chroot "$ROOT" "$C" "$@"
+ [ -n "${C}" ] && chroot "${ROOT}" "${C}" "${@}"
}
-root="$1"
-package="$2"
+root="${1}"
+package="${2}"
-version=$(runcommandinroot "$root" dpkg-query -W --showformat='${Version}' "$package" 2>/dev/null) || version=""
+version=$(runcommandinroot "${root}" dpkg-query -W --showformat='${Version}' "${package}" 2>/dev/null) || version=""
-if [ -z "$version" ]
+if [ -z "${version}" ]
then
- echo >&2 "$0: package '$package' is not installed"
+ echo >&2 "${0}: package '${package}' is not installed"
exit 0
fi
-runcommandinroot "$root" dpkg-reconfigure -fnoninteractive --no-reload "$package"
+runcommandinroot "${root}" dpkg-reconfigure -fnoninteractive --no-reload "${package}"
exit 0
diff --git a/bin/live-snapshot b/bin/live-snapshot
index 989fd3a..e508c2a 100755
--- a/bin/live-snapshot
+++ b/bin/live-snapshot
@@ -99,7 +99,7 @@ Help ()
echo "Options:"
echo " -c, --cow: specifies the copy on write directory (default: /live/cow)."
echo " -d, --device: specifies the output snapshot device (default: none)."
- echo " -o, --output: specifies the output image file (default: $type dependent)."
+ echo " -o, --output: specifies the output image file (default: ${type} dependent)."
echo " -r, --resync-string: internally used to resync previous made snapshots."
echo " -t, --type: specifies the snapshot type between \"squashfs\", \"ext2\", \"ext3\" or \"cpio\".gz archive (default: cpio)"
echo -e "\nLook at live-snapshot(1) man page for more information."
@@ -164,8 +164,8 @@ Do_snapshot ()
Is_same_mount ()
{
- dir1="$(Base_path $1)"
- dir2="$(Base_path $2)"
+ dir1="$(Base_path ${1})"
+ dir2="$(Base_path ${2})"
if [ "${dir1}" = "${dir2}" ]
then
@@ -178,10 +178,10 @@ Is_same_mount ()
Parse_args ()
{
# Parse command line
- ARGS="$1"
+ ARGS="${1}"
ARGUMENTS="$(getopt --longoptions cow:,device:,output,resync-string:,type:,help,usage,version --name=${PROGRAM} --options c:d:o:t:r:,h,u,v --shell sh -- ${ARGS})"
- if [ "$?" != "0" ]
+ if [ "${?}" != "0" ]
then
echo "Terminating." >&2
exit 1
@@ -191,29 +191,29 @@ Parse_args ()
while true
do
- case "$1" in
+ case "${1}" in
-c|--cow)
- SNAP_COW="$2"
+ SNAP_COW="${2}"
shift 2
;;
-d|--device)
- SNAP_DEV="$2"
+ SNAP_DEV="${2}"
shift 2
;;
-o|--output)
- SNAP_OUTPUT="$2"
+ SNAP_OUTPUT="${2}"
shift 2
;;
-t|--type)
- SNAP_TYPE="$2"
+ SNAP_TYPE="${2}"
shift 2
;;
-r|--resync-string)
- SNAP_RSTRING="$2"
+ SNAP_RSTRING="${2}"
break
;;
@@ -243,7 +243,7 @@ Parse_args ()
Mount_device ()
{
- dev="$1"
+ dev="${1}"
if [ ! -d "${MOUNTP}" ]
then
@@ -255,9 +255,9 @@ Mount_device ()
# create a temp
mount -t tmpfs -o rw tmpfs "${MOUNTP}"
- if [ ! -L /home/$USERNAME/Desktop/live-snapshot ]
+ if [ ! -L /home/${USERNAME}/Desktop/live-snapshot ]
then
- ln -s "${MOUNTP}" /home/$USERNAME/Desktop/live-snapshot
+ ln -s "${MOUNTP}" /home/${USERNAME}/Desktop/live-snapshot
fi
else
if [ -b "${dev}" ]
@@ -274,7 +274,7 @@ Defaults ()
DEV=""
DEST="${MOUNTP}/live-sn.cpio.gz"
TYPE="cpio"
- DESKTOP_LINK=/home/$USERNAME/Desktop/live-snapshot
+ DESKTOP_LINK=/home/${USERNAME}/Desktop/live-snapshot
if [ -n "${SNAP_RSTRING}" ]
then
@@ -334,12 +334,12 @@ Defaults ()
Usage "Error: ${COW} is not a directory"
fi
- Mount_device $DEV
+ Mount_device ${DEV}
}
Clean ()
{
- if [ -n "$DEV" ]
+ if [ -n "${DEV}" ]
then
umount "${MOUNTP}"
rmdir "${MOUNTP}"
@@ -349,10 +349,10 @@ Clean ()
Main ()
{
- Parse_args "$@"
+ Parse_args "${@}"
Defaults
Do_snapshot
Clean
}
-Main "$@"
+Main "${@}"