rebase to xenial
This commit is contained in:
parent
b9224a43b0
commit
501683a3d5
13 changed files with 111 additions and 715 deletions
31
root/etc/cont-init.d/10_add_user
Normal file
31
root/etc/cont-init.d/10_add_user
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#!/usr/bin/with-contenv bash
|
||||
|
||||
|
||||
|
||||
PUID=${PUID:-911}
|
||||
PGID=${PGID:-911}
|
||||
|
||||
if [ ! "$(id -u abc)" -eq "$PUID" ]; then usermod -o -u "$PUID" abc ; fi
|
||||
if [ ! "$(id -g abc)" -eq "$PGID" ]; then groupmod -o -g "$PGID" abc ; fi
|
||||
|
||||
echo "
|
||||
-------------------------------------
|
||||
_ _ _
|
||||
| |___| (_) ___
|
||||
| / __| | |/ _ \
|
||||
| \__ \ | | (_) |
|
||||
|_|___/ |_|\___/
|
||||
|_|
|
||||
|
||||
Brought to you by linuxserver.io
|
||||
We do accept donations at:
|
||||
https://www.linuxserver.io/donations
|
||||
-------------------------------------
|
||||
GID/UID
|
||||
-------------------------------------
|
||||
User uid: $(id -u abc)
|
||||
User gid: $(id -g abc)
|
||||
-------------------------------------
|
||||
"
|
||||
chown abc:abc /config
|
||||
chown abc:abc /defaults
|
||||
9
root/etc/cont-init.d/20-dbus
Normal file
9
root/etc/cont-init.d/20-dbus
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/with-contenv bash
|
||||
|
||||
[[ -e /var/run/dbus/pid ]] && rm -f /var/run/dbus/pid
|
||||
|
||||
mkdir -p /var/run/dbus
|
||||
chown messagebus:messagebus /var/run/dbus
|
||||
dbus-uuidgen --ensure
|
||||
sleep 1
|
||||
|
||||
53
root/etc/cont-init.d/30-plex-update
Normal file
53
root/etc/cont-init.d/30-plex-update
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
#!/usr/bin/with-contenv bash
|
||||
|
||||
# opt out for autoupdates
|
||||
[ "$ADVANCED_DISABLEUPDATES" ] && exit 0
|
||||
|
||||
|
||||
#The following error is not an error.
|
||||
INSTALLED=$(dpkg-query -W -f='${Version}' plexmediaserver)
|
||||
|
||||
|
||||
#Get stuff from things.
|
||||
PLEX_TOKEN=$( sed -n 's/.*PlexOnlineToken="//p' "/config/Library/Application Support/Plex Media Server/Preferences.xml" | sed "s/\".*//")
|
||||
[ -z "$PLEX_TOKEN" ] && echo "Plex token not avalible, please login " && exit 0
|
||||
|
||||
[ "$PLEXPASS" ] && echo "PLEXPASS is deprecated, please use VERSION"
|
||||
if [[ -z $VERSION && "$PLEXPASS" == "1" || $VERSION = "plexpass" ]]; then echo "VERSION=plexpass is depricated please use version latest"; fi
|
||||
|
||||
|
||||
#Start update rutine
|
||||
|
||||
|
||||
if [[ "$VERSION" = latest || "$VERSION" = plexpass ]]; then
|
||||
VERSION=$(curl -s "https://plex.tv/downloads/latest/1?channel=8&build=linux-ubuntu-x86_64&distro=ubuntu&X-Plex-Token=$PLEX_TOKEN"| cut -d "/" -f 5 )
|
||||
echo "Target version: $VERSION set by: latest\plexpass"
|
||||
elif [[ "$VERSION" = public ]]; then
|
||||
VERSION=$(curl -s "https://plex.tv/downloads/latest/1?channel=8&build=linux-ubuntu-x86_64&distro=ubuntu&X-Plex-Token="| cut -d "/" -f 5 )
|
||||
echo "Target version: $VERSION set by: public"
|
||||
elif [[ -z "$VERSION" ]]; then
|
||||
echo "Target version: Version not set, Defaulting to supplied version"
|
||||
else
|
||||
echo "Target version: $VERSION set by: manually"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
last=130
|
||||
if [[ "$VERSION" == "" ]]; then
|
||||
echo "ERROR: No version found, running installed version $INSTALLED"
|
||||
elif [[ "$VERSION" != "$INSTALLED" ]]; then
|
||||
echo "Upgrading from version: $INSTALLED to version: $VERSION"
|
||||
while [[ $last -ne "0" ]]; do
|
||||
rm -f /tmp/plexmediaserver_*.deb
|
||||
wget -P /tmp "https://downloads.plex.tv/plex-media-server/$VERSION/plexmediaserver_${VERSION}_amd64.deb"
|
||||
last=$?
|
||||
done
|
||||
apt-get remove --purge -y plexmediaserver
|
||||
dpkg -i /tmp/plexmediaserver_"${VERSION}"_amd64.deb
|
||||
else
|
||||
echo "No need to update!"
|
||||
fi
|
||||
cp -v /defaults/plexmediaserver /etc/default/plexmediaserver
|
||||
|
||||
12
root/etc/cont-init.d/40-chown-files
Normal file
12
root/etc/cont-init.d/40-chown-files
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/with-contenv bash
|
||||
|
||||
if [ ! -d "/config/Library" ]; then
|
||||
mkdir /config/Library
|
||||
chown abc:abc /config/Library
|
||||
fi
|
||||
|
||||
if [ ! -f "/config/Library/linuxserver-chown.lock" ]; then
|
||||
find /config/Library ! \( -user abc -a -group root \) -print0 | xargs -0 chown abc:root
|
||||
touch /config/Library/linuxserver-chown.lock
|
||||
fi
|
||||
|
||||
9
root/etc/services.d/avahi/run
Normal file
9
root/etc/services.d/avahi/run
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/with-contenv bash
|
||||
|
||||
until [[ -e /var/run/dbus/system_bus_socket ]]; do
|
||||
sleep 1s
|
||||
done
|
||||
|
||||
echo "Starting Avahi daemon"
|
||||
exec avahi-daemon --no-chroot
|
||||
|
||||
5
root/etc/services.d/dbus/run
Normal file
5
root/etc/services.d/dbus/run
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/with-contenv bash
|
||||
|
||||
echo "Starting dbus-daemon"
|
||||
exec dbus-daemon --system --nofork
|
||||
|
||||
5
root/etc/services.d/plex/run
Normal file
5
root/etc/services.d/plex/run
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/with-contenv bash
|
||||
|
||||
echo "Starting Plex Media Server."
|
||||
exec s6-setuidgid abc /usr/sbin/start_pms
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue