Magellan Linux

Diff of /trunk/mage/usr/lib/mage/museradd

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2141 by niro, Fri Oct 12 12:56:07 2012 UTC revision 2142 by niro, Mon Jul 15 08:13:49 2013 UTC
# Line 31  busybox_fix_user_opts() Line 31  busybox_fix_user_opts()
31   -G) shift; shift; continue;; # will be parsed through fix_group_opts   -G) shift; shift; continue;; # will be parsed through fix_group_opts
32   -u) shift; [[ $1 -lt 100 ]] && FIXED_USER_OPTS+=" -S"; FIXED_USER_OPTS+=" -u $1" ;;   -u) shift; [[ $1 -lt 100 ]] && FIXED_USER_OPTS+=" -S"; FIXED_USER_OPTS+=" -u $1" ;;
33   -r) FIXED_USER_OPTS+=" -S" ;;   -r) FIXED_USER_OPTS+=" -S" ;;
34     -M) FIXED_USER_OPTS+=" -H" ;;
35   *) FIXED_USER_OPTS+=" $1" ;;   *) FIXED_USER_OPTS+=" $1" ;;
36   esac   esac
37   shift   shift
# Line 55  busybox_fix_group_opts() Line 56  busybox_fix_group_opts()
56   echo "${FIXED_GROUP_OPTS}"   echo "${FIXED_GROUP_OPTS}"
57  }  }
58    
59    fix_usermod_opts()
60    {
61     local i
62     local FIXED_USERMOD_OPTS
63    
64     for i in $*
65     do
66     case $1 in
67     -M) continue ;; # usermod does not support the -M switch
68     *) FIXED_USERMOD_OPTS+=" $1" ;;
69     esac
70     shift
71     done
72    
73     echo "${FIXED_USERMOD_OPTS}"
74    }
75    
76  if [[ ! -z ${MROOT} ]] && [[ ${MROOT} != / ]]  if [[ ! -z ${MROOT} ]] && [[ ${MROOT} != / ]]
77  then  then
78   chroot="chroot ${MROOT} "   chroot="chroot ${MROOT} "
# Line 115  else Line 133  else
133   echo -n "     Modifing user '${USER_TO_ADD}'"   echo -n "     Modifing user '${USER_TO_ADD}'"
134   [[ ! -z ${chroot} ]] && echo -n " in MROOT='${MROOT}'"   [[ ! -z ${chroot} ]] && echo -n " in MROOT='${MROOT}'"
135   echo " ..."   echo " ..."
136   ${chroot} usermod ${USER_OPTS} "${USER_TO_ADD}"   ${chroot} usermod $(fix_usermod_opts ${USER_OPTS}) "${USER_TO_ADD}"
137   fi   fi
138  fi  fi

Legend:
Removed from v.2141  
changed lines
  Added in v.2142