break at 80 lines
This commit is contained in:
parent
dc2127c06c
commit
8c6d3ee062
@ -1,27 +1,30 @@
|
|||||||
post_install() {
|
post_install() {
|
||||||
getent group kodi > /dev/null || groupadd -g 420 kodi
|
getent group kodi > /dev/null || groupadd -g 420 kodi
|
||||||
if ! getent passwd kodi > /dev/null; then
|
if ! getent passwd kodi > /dev/null; then
|
||||||
useradd -c 'kodi user' -u 420 -g kodi -G audio,video,network,optical -d /var/lib/kodi -s /usr/bin/nologin kodi
|
useradd -c 'kodi user' -u 420 -g kodi -G audio,video,network,optical \
|
||||||
passwd -l kodi > /dev/null
|
-d /var/lib/kodi -s /usr/bin/nologin kodi
|
||||||
[[ ! -d /var/lib/kodi/.kodi ]] && mkdir /var/lib/kodi/.kodi && chown -R kodi:kodi /var/lib/kodi/.kodi
|
passwd -l kodi > /dev/null
|
||||||
fi
|
[[ ! -d /var/lib/kodi/.kodi ]] &&
|
||||||
|
mkdir /var/lib/kodi/.kodi &&
|
||||||
|
chown -R kodi:kodi /var/lib/kodi/.kodi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
post_upgrade() {
|
post_upgrade() {
|
||||||
post_install $1
|
post_install $1
|
||||||
if ! getent group kodi | cut -d: -f3 | grep 420 > /dev/null 2>&1; then
|
if ! getent group kodi | cut -d: -f3 | grep 420 > /dev/null 2>&1; then
|
||||||
groupmod -g 420 kodi > /dev/null 2>&1
|
groupmod -g 420 kodi > /dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
if ! id -u kodi | grep 420 > /dev/null 2>&1; then
|
if ! id -u kodi | grep 420 > /dev/null 2>&1; then
|
||||||
usermod -u 420 kodi > /dev/null 2>&1
|
usermod -u 420 kodi > /dev/null 2>&1
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
echo "Changing uid of user kodi failed."
|
echo "Changing uid of user kodi failed."
|
||||||
echo "It is recommended that the uid is changed."
|
echo "It is recommended that the uid is changed."
|
||||||
echo "Stop all processes running under the kodi user and reinstall kodi"
|
echo "Stop all processes running under the kodi user and reinstall kodi"
|
||||||
echo "or change the uid manually. (usermod -u 420 kodi)"
|
echo "or change the uid manually. (usermod -u 420 kodi)"
|
||||||
fi
|
fi
|
||||||
chown -R kodi:kodi /var/lib/kodi
|
chown -R kodi:kodi /var/lib/kodi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -d /var/lib/xbmc ]]; then
|
if [[ -d /var/lib/xbmc ]]; then
|
||||||
echo "If you are upgrading from xbmc->kodi and wish to keep your"
|
echo "If you are upgrading from xbmc->kodi and wish to keep your"
|
||||||
@ -33,8 +36,8 @@ post_upgrade() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
post_remove() {
|
post_remove() {
|
||||||
getent passwd kodi > /dev/null 2>&1 && userdel kodi
|
getent passwd kodi > /dev/null 2>&1 && userdel kodi
|
||||||
getent group kodi > /dev/null 2>&1 && groupdel kodi
|
getent group kodi > /dev/null 2>&1 && groupdel kodi
|
||||||
}
|
}
|
||||||
|
|
||||||
post_message() {
|
post_message() {
|
||||||
|
Loading…
Reference in New Issue
Block a user