Skip to content

Commit

Permalink
v6.22 (#2554)
Browse files Browse the repository at this point in the history
+ DietPi-Software | Plex Media Server: Now installs the latest version automatically (currently 1.15) which as well includes official ARM binaries.
+ DietPi-Software/Process_tool | Minor coding
  • Loading branch information
MichaIng authored Mar 15, 2019
1 parent 31f4900 commit 9b4cd69
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 59 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Changes / Improvements / Optimisations:
- DietPi-Software | Netdata: On Debian Stretch/Buster and Raspbian Buster an up-to-date APT package is available, which will now be installed instead of our custom build. Many thanks to @74cmonty for this information: https://github.com/MichaIng/DietPi/issues/2446
- DietPi-Software | DietPi-RAMlog: When installing/enabling RAMlog, the /var/log mountpoint will be now cleaned before mounting the tmpfs on it, while preserving the existing logs metadata. This resolves a warning on early boot stage and frees the disk space consumed by the disk log before.
- DietPi-Software | rTorrent: Runs now as user "rtorrent" and creates files as group "dietpi" with 775/664 permissions. Enabled Buster support and enhanced config file handling on reinstall: https://github.com/MichaIng/DietPi/pull/2633
- DietPi-Software | Plex Media Server: Now installs the latest version automatically (currently 1.15) which as well includes official ARM binaries. Many thanks to @WolfganP for informing us about this new release: https://github.com/MichaIng/DietPi/issues/2553

Bug Fixes:
- System | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2529
Expand Down
26 changes: 14 additions & 12 deletions dietpi/dietpi-process_tool
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@

#Import DietPi-Globals ---------------------------------------------------------------
. /DietPi/dietpi/func/dietpi-globals
G_CHECK_ROOT_USER
G_PROGRAM_NAME='DietPi-Process_tool'
G_CHECK_ROOT_USER
G_INIT
#Import DietPi-Globals ---------------------------------------------------------------

#Grab Input
INPUT=0
disable_error=1 G_CHECK_VALIDINT $1 && INPUT=$1
disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 || INPUT=0

#/////////////////////////////////////////////////////////////////////////////////////
# Globals
Expand Down Expand Up @@ -171,6 +170,9 @@

done <<< "$(pgrep -f "${aPROCESS_NAME[$i]}")"

# PMS v1.15: Renice com.plexapp.system sub process to 15 which it spawns at
[[ ${aNAME[$i]} == 'Plex Media Server' ]] && renice -n 15 -p $(pgrep -f 'com.plexapp.system') &> /dev/null

fi

done
Expand Down Expand Up @@ -306,8 +308,8 @@
while read line
do

aNAME[$index]="$(sed 's/:.*$//' <<< $line)"
aPROCESS_NAME[$index]="$(sed 's/^.*://' <<< $line)"
aNAME[$index]=$(sed 's/:.*$//' <<< $line)
aPROCESS_NAME[$index]=$(sed 's/^.*://' <<< $line)
((index++))

done < $fp_include
Expand Down Expand Up @@ -358,10 +360,10 @@
do

# - available schedulers
aSCHEDULE_AVAILABLE_POLICY[$index]="${line%%[[:blank:]]*}"
aSCHEDULE_AVAILABLE_POLICY[$index]=${line%%[[:blank:]]*}

# - available priorities
line="${line##*: }"
line=${line##*: }
# -- min
aSCHEDULE_AVAILABLE_PRIORITY_MIN[$index]=${line%/*}
# -- max
Expand Down Expand Up @@ -500,7 +502,7 @@ _EOF_

done

G_WHIP_DEFAULT_ITEM="$LAST_SELECTED_NAME"
G_WHIP_DEFAULT_ITEM=$LAST_SELECTED_NAME
G_WHIP_BUTTON_CANCEL_TEXT='Exit'
if G_WHIP_MENU 'Please select a program:'; then

Expand Down Expand Up @@ -591,7 +593,7 @@ _EOF_

done

G_WHIP_DEFAULT_ITEM="$nice_current"
G_WHIP_DEFAULT_ITEM=$nice_current
G_WHIP_MENU "Please select your nice level for:\n${aNAME[$index_current]}\n\nInfo:\n - Negative values have a higher priority (eg: -10).\n - Positive values have a lower priority (eg: 15).\n - The default value is 0."
if (( ! $? )); then

Expand Down Expand Up @@ -644,7 +646,7 @@ _EOF_
done

#Update affinity array with new value, if at least 1 item was selected.
[[ $new_affinity ]] && aAFFINITY[$index_current]="$new_affinity"
[[ $new_affinity ]] && aAFFINITY[$index_current]=$new_affinity

#Apply
Apply_Process_Tool
Expand Down Expand Up @@ -687,7 +689,7 @@ _EOF_

done

G_WHIP_DEFAULT_ITEM="${aSCHEDULE_POLICY[$index_current]}"
G_WHIP_DEFAULT_ITEM=${aSCHEDULE_POLICY[$index_current]}
if G_WHIP_MENU "Please select a Schedule Policy for :\n${aNAME[$index_current]}"; then

aSCHEDULE_POLICY[$index_current]=$G_WHIP_RETURNED_VALUE
Expand Down Expand Up @@ -771,7 +773,7 @@ _EOF_

done

G_WHIP_DEFAULT_ITEM="${aSCHEDULE_PRIORITY[$index_current]}"
G_WHIP_DEFAULT_ITEM=${aSCHEDULE_PRIORITY[$index_current]}
G_WHIP_MENU "Please select a Schedule Priority level for :\n${aNAME[$index_current]}\n\n - Lower values are low priority\n - Higher values are high priority"
if (( ! $? )); then

Expand Down
71 changes: 24 additions & 47 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -5246,46 +5246,33 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior

fi

#PLEXMEDIASERVER
software_id=42
software_id=42 # Plex Media Server
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then

Banner_Installing

#x86_64
if (( $G_HW_ARCH == 10 )); then

Download_Install 'https://downloads.plex.tv/plex-media-server/1.14.0.5470-9d51fdfaa/plexmediaserver_1.14.0.5470-9d51fdfaa_amd64.deb'

#ARM
else

INSTALL_URL_ADDRESS='https://dev2day.de/pms/'
G_CHECK_URL "$INSTALL_URL_ADDRESS"

echo "deb [arch=armhf] $INSTALL_URL_ADDRESS $G_DISTRO_NAME main" > /etc/apt/sources.list.d/plex.list
wget -O - "$INSTALL_URL_ADDRESS"dev2day-pms.gpg.key | apt-key add -

# Buster: Revert repo to Stretch, as Buster is not yet available
sed -i 's/buster/stretch/g' /etc/apt/sources.list.d/plex.list
# Derive latest version from: https://plex.tv/pms/downloads/5
INSTALL_URL_ADDRESS='https://plex.tv/pms/downloads/5'
G_CHECK_URL "$INSTALL_URL_ADDRESS"

#ARMv8: Install 32bit binaries
if (( $G_HW_ARCH == 3 )); then
# ARMv7
local arch='armhf'

dpkg --add-architecture armhf
G_AGUP
G_AGI libstdc++6:armhf plexmediaserver-installer:armhf
# ARMv8
if (( $G_HW_ARCH == 3 )); then

#ARM32
else
arch='arm64'

G_AGUP
G_AGI plexmediaserver-installer
# x86_64
elif (( $G_HW_ARCH == 10 )); then

fi
arch='amd64'

fi

# Derive URL from arch
no_check_url=1 Download_Install "$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 "distro=\"debian\".*$arch\.deb" | cut -d \" -f 8)"

fi

#CUBERITE
Expand Down Expand Up @@ -5537,7 +5524,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior

fi

no_check_url=1 Download_Install "$(curl -s $INSTALL_URL_ADDRESS | grep -m1 "browser_download_url.*linux-$arch-v[0-9.]*tar\.gz" | cut -d \" -f 4)" /etc
no_check_url=1 Download_Install "$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 "browser_download_url.*linux-$arch-v[0-9.]*tar\.gz" | cut -d \" -f 4)" /etc
mv /etc/syncthing-* /etc/syncthing

fi
Expand Down Expand Up @@ -5834,7 +5821,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior

INSTALL_URL_ADDRESS='https://api.github.com/repos/Radarr/Radarr/releases'
G_CHECK_URL "$INSTALL_URL_ADDRESS" #full filepath below, returns --spider error :(
INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*linux.tar.gz' | cut -d \" -f 4)
INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*linux\.tar\.gz' | cut -d \" -f 4)

DEPS_LIST='mediainfo'
no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS" /opt
Expand All @@ -5849,7 +5836,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior

INSTALL_URL_ADDRESS='https://api.github.com/repos/Lidarr/Lidarr/releases'
G_CHECK_URL "$INSTALL_URL_ADDRESS"
INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*linux.tar.gz' | cut -d \" -f 4)
INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*linux\.tar\.gz' | cut -d \" -f 4)

DEPS_LIST='mediainfo'
no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS" /opt
Expand Down Expand Up @@ -5890,7 +5877,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior

INSTALL_URL_ADDRESS='https://api.github.com/repos/Jackett/Jackett/releases/latest'
G_CHECK_URL "$INSTALL_URL_ADDRESS" #full filepath below, returns --spider error :(
INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*Jackett.Binaries.Mono.tar.gz' | cut -d \" -f 4)
INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*Jackett\.Binaries\.Mono\.tar\.gz' | cut -d \" -f 4)

no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS" /opt

Expand Down Expand Up @@ -10675,22 +10662,12 @@ location = /.well-known/caldav {

fi

#PLEXMEDIASERVER
software_id=42
software_id=42 # Plex Media Server
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then

Banner_Configuration
Download_Test_Media

# For all ARM devices:
# - en_US.UTF-8 must be installed and the default locale on system. This is for SBC installs using dev2day repo: https://github.com/MichaIng/DietPi/issues/116#issuecomment-222195911
if (( $G_HW_ARCH < 10 )) && ! locale | grep -q 'en_US.UTF-8'; then

G_WHIP_MSG 'Plex Media Server requires en_US.UTF-8 locale to be installed and set to default, else, Plex will not start.\n\nThe installer will now change your locale to: en_US.UTF-8'
/DietPi/dietpi/func/dietpi-set_software locale 'en_US.UTF-8'

fi

# Run service as "dietpi" group: https://github.com/MichaIng/DietPi/issues/350#issuecomment-423763518
mkdir -p /etc/systemd/system/plexmediaserver.service.d
echo -e '[Service]\nGroup=dietpi' > /etc/systemd/system/plexmediaserver.service.d/dietpi-group.conf
Expand Down Expand Up @@ -14008,22 +13985,22 @@ _EOF_

fi

software_id=42
software_id=42 # Plex Media Server
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then

Banner_Uninstalling
G_AGP $(dpkg --get-selections plexmediaserver* | mawk '{print $1}')
[[ -d /var/lib/plexmediaserver ]] && rm -R /var/lib/plexmediaserver
[[ -f etc/apt/sources.list.d/plex.list ]] && rm /etc/apt/sources.list.d/plex.list && G_AGUP
[[ -d /etc/systemd/system/plexmediaserver.service.d ]] && rm -R /etc/systemd/system/plexmediaserver.service.d # post v6.17
[[ -d /var/lib/plexmediaserver ]] && rm -R /var/lib/plexmediaserver # pre v6.22 Plex v1.15
[[ -f etc/apt/sources.list.d/plex.list ]] && rm /etc/apt/sources.list.d/plex.list && G_AGUP # pre v6.22

fi

software_id=52
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then

Banner_Uninstalling
rm -R /etc/cuberite &> /dev/null #v6.11<
rm -R /etc/cuberite &> /dev/null # pre v6.11
rm -R $G_FP_DIETPI_USERDATA/cubrite
rm /etc/systemd/system/cuberite.service

Expand Down

0 comments on commit 9b4cd69

Please sign in to comment.