diff options
author | Nicolás Reynolds <fauno@endefensadelsl.org> | 2015-01-27 11:41:49 -0300 |
---|---|---|
committer | Nicolás Reynolds <fauno@endefensadelsl.org> | 2015-01-27 11:41:49 -0300 |
commit | 27aa494d6370c4193a98b2df3502d07ba655be68 (patch) | |
tree | fdfdb8dce4fb22a3271b0d559cdd22be9dc9552a /pcr/kodi-standalone-service/readme.install | |
parent | a896c7cb7d5909a49f4bf4d6967189ab7860582b (diff) | |
parent | c5c563eec2438ec16a57c95d22800de5a99171ef (diff) |
Merge branch 'master' of git://projects.parabola.nu/abslibre/abslibre
Diffstat (limited to 'pcr/kodi-standalone-service/readme.install')
-rw-r--r-- | pcr/kodi-standalone-service/readme.install | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/pcr/kodi-standalone-service/readme.install b/pcr/kodi-standalone-service/readme.install new file mode 100644 index 000000000..0f5edbec0 --- /dev/null +++ b/pcr/kodi-standalone-service/readme.install @@ -0,0 +1,37 @@ +post_install() { + getent group xbmc > /dev/null || groupadd -g 420 xbmc + if ! getent passwd xbmc > /dev/null; then + useradd -c 'XBMC user' -u 420 -g xbmc -G audio,video,network,optical -d /var/lib/xbmc -s /sbin/nologin xbmc + passwd -l xbmc > /dev/null + fi +} + +post_upgrade() { + post_install $1 + if ! getent group xbmc | cut -d: -f3 | grep 420 > /dev/null 2>&1; then + groupmod -g 420 xbmc > /dev/null 2>&1 + fi + if ! id -u xbmc | grep 420 > /dev/null 2>&1; then + usermod -u 420 xbmc > /dev/null 2>&1 + if [[ $? -ne 0 ]]; then + echo "Changing uid of user xbmc failed" + echo "It is recommended that the uid is changed." + echo "Stop all processes running under the xbmc user and reinstall xbmc" + echo "or change the uid manually. (usermod -u 420 xbmc)" + fi + chown -R xbmc:xbmc /var/lib/xbmc + fi +} + +post_remove() { + getent passwd xbmc > /dev/null 2>&1 && userdel xbmc + getent group xbmc > /dev/null 2>&1 && groupdel xbmc +} + +post_message() { + echo "To autostart xbmc standalone, you must create or modify" + echo "/etc/X11/Xwrapper.config to contain the following 2 lines:" + echo + echo "allowed_users = anybody" + echo "needs_root_rights = yes" +} |