diff options
author | Tom Gundersen <teg@jklm.no> | 2012-04-30 13:18:08 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2012-04-30 13:18:08 +0200 |
commit | 9c4d4c1b9766086e0b8e2464d32d4ac0886627c1 (patch) | |
tree | 2d49797931c4d7fd08c25d1a2d87393194fd301c | |
parent | 222cefd41344f82a88dbf2b4a9480c966884d0e7 (diff) | |
parent | 4d6178953060b79af0b2aa14d36c972989662d35 (diff) |
Merge remote-tracking branch 'falconindy/master'
-rw-r--r-- | functions | 41 | ||||
-rw-r--r-- | locale.sh | 12 |
2 files changed, 24 insertions, 29 deletions
@@ -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 + } } @@ -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 |