diff options
author | lcapriotti <lcapriotti@svn> | 2010-03-22 15:18:12 +0000 |
---|---|---|
committer | lcapriotti <lcapriotti@svn> | 2010-03-22 15:18:12 +0000 |
commit | e5db43df690a1869a0cd48e3b3fb94bc1888de3e (patch) | |
tree | afd1d5e9f9fdfce62d1db7cc719588a0b6313e87 /tools | |
parent | f8d4103642d986a1a4a7e2b940a7e547c7eac900 (diff) |
Fix for #8928: allow using custom UID
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@28748 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/Linux/packaging/debian/xbmc-live.postinst | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/tools/Linux/packaging/debian/xbmc-live.postinst b/tools/Linux/packaging/debian/xbmc-live.postinst index 8f5d430a11..6e21b6939c 100755 --- a/tools/Linux/packaging/debian/xbmc-live.postinst +++ b/tools/Linux/packaging/debian/xbmc-live.postinst @@ -11,16 +11,22 @@ case "$1" in # get a console session going, we're in trouble anyway. ceros sed -i.bak-xbmc-live s/allowed_users=console/allowed_users=anybody/ /etc/X11/Xwrapper.config - # Add the 'xbmc' user if the primary one is missing - xbmcUser=$(getent passwd 1000 | sed -e 's/\:.*//') - if [ ! -n "$xbmcUser" ]; then - clearTextPWD=xbmc - encryptedPWD=$(echo $clearTextPWD | mkpasswd -s) + xbmcUser=xbmc + # Read configuration variable file if it is present + [ -r /etc/default/xbmc-live ] && . /etc/default/xbmc-live - adduser --disabled-password --gecos "XBMC Live User" xbmc - usermod -p $encryptedPWD xbmc + if ! getent passwd $xbmcUser >/dev/null; then + xbmcUser=$(getent passwd 1000 | sed -e 's/\:.*//') + if [ -z "$xbmcUser" ]; then + # Add the 'xbmc' user if the primary one is missing + clearTextPWD=xbmc + encryptedPWD=$(echo $clearTextPWD | mkpasswd -s) - xbmcUser=xbmc + adduser --disabled-password --gecos "XBMC Live User" xbmc + usermod -p $encryptedPWD xbmc + + xbmcUser=xbmc + fi fi # Add 'xbmcUser' user to the appropriate groups |