aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2012-04-30 13:18:08 +0200
committerTom Gundersen <teg@jklm.no>2012-04-30 13:18:08 +0200
commit9c4d4c1b9766086e0b8e2464d32d4ac0886627c1 (patch)
tree2d49797931c4d7fd08c25d1a2d87393194fd301c
parent222cefd41344f82a88dbf2b4a9480c966884d0e7 (diff)
parent4d6178953060b79af0b2aa14d36c972989662d35 (diff)
downloadinitscripts-9c4d4c1b9766086e0b8e2464d32d4ac0886627c1.tar.xz
Merge remote-tracking branch 'falconindy/master'
-rw-r--r--functions41
-rw-r--r--locale.sh12
2 files changed, 24 insertions, 29 deletions
diff --git a/functions b/functions
index 3096aaa..7516345 100644
--- a/functions
+++ b/functions
@@ -549,32 +549,31 @@ mount_all() {
umount_all() {
# $1: restrict to fstype
- local mounts
+ findmnt -mrunRo TARGET,FSTYPE,OPTIONS / | {
+ while read -r target fstype options; do
+ # match only targetted fstypes
+ if [[ $1 && $1 != "$fstype" ]]; then
+ continue
+ fi
- while read -r target fstype options; do
+ # don't unmount API filesystems
+ if [[ $target = /@(proc|sys|run|dev|dev/pts) ]]; then
+ continue
+ fi
- # match only targetted fstypes
- if [[ $1 && $1 != "$fstype" ]]; then
- continue
- fi
+ # avoid networked devices
+ IFS=, read -ra opts <<< "$options"
+ if in_array _netdev "${opts[@]}"; then
+ continue
+ fi
- # don't unmount API filesystems
- if [[ $target = /@(proc|sys|run|dev|dev/pts) ]]; then
- continue
- fi
+ mounts=("$target" "${mounts[@]}")
+ done
- # avoid networked devices
- IFS=, read -ra opts <<< "$options"
- if in_array _netdev "${opts[@]}"; then
- continue
+ if (( ${#mounts[*]} )); then
+ umount -r "${mounts[@]}"
fi
-
- mounts=("$target" "${mounts[@]}")
- done < <(findmnt -mrunRo TARGET,FSTYPE,OPTIONS /)
-
- if (( ${#mounts[*]} )); then
- umount -r "${mounts[@]}"
- fi
+ }
}
diff --git a/locale.sh b/locale.sh
index fe82378..c465f6f 100644
--- a/locale.sh
+++ b/locale.sh
@@ -4,16 +4,12 @@ if [ -s /etc/locale.conf ]; then
. /etc/locale.conf
fi
-if [ -n "$LANG" ]; then
- export LANG
-else
- if [ -s /etc/rc.conf ]; then
- export LANG=$(. /etc/rc.conf 2> /dev/null ; echo "$LOCALE")
- else
- export LANG="C"
- fi
+if [ -z "$LANG" ] && [ -s /etc/rc.conf ]; then
+ LANG=$(. /etc/rc.conf 2>/dev/null; echo "$LOCALE")
fi
+export LANG=${LANG:-C}
+
if [ -n "$LC_CTYPE" ]; then
export LC_CTYPE
else