summaryrefslogtreecommitdiffstats
path: root/linhes/linhes-system
diff options
context:
space:
mode:
Diffstat (limited to 'linhes/linhes-system')
-rw-r--r--linhes/linhes-system/69-hdparm.rules1
-rwxr-xr-xlinhes/linhes-system/PKGBUILD23
-rwxr-xr-xlinhes/linhes-system/add_storage.py19
-rwxr-xr-xlinhes/linhes-system/empty_storage_groups.py22
-rwxr-xr-xlinhes/linhes-system/idle.py20
-rwxr-xr-xlinhes/linhes-system/lh_system_backup_job2
-rwxr-xr-xlinhes/linhes-system/lh_system_start.sh2
-rw-r--r--linhes/linhes-system/linhes-profile.sh2
8 files changed, 64 insertions, 27 deletions
diff --git a/linhes/linhes-system/69-hdparm.rules b/linhes/linhes-system/69-hdparm.rules
new file mode 100644
index 0000000..414698e
--- /dev/null
+++ b/linhes/linhes-system/69-hdparm.rules
@@ -0,0 +1 @@
+ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="sd*", ATTRS{queue/rotational}=="1", RUN+="/usr/bin/hdparm -B 254 -S 0 $env{DEVNAME}"
diff --git a/linhes/linhes-system/PKGBUILD b/linhes/linhes-system/PKGBUILD
index 96121e2..91abbd9 100755
--- a/linhes/linhes-system/PKGBUILD
+++ b/linhes/linhes-system/PKGBUILD
@@ -1,14 +1,15 @@
pkgname=linhes-system
pkgver=9.0.0
-pkgrel=93
+pkgrel=100
arch=('x86_64')
#install=$pkgname.install
pkgdesc="Everything that makes LinHES a system"
license=('GPL2')
depends=('cronie' 'dbus-python' 'dvb-firmware' 'expect' 'flatpak' 'firefox' 'glances' 'inetutils'
'kdialog' 'kwalletmanager' 'libnotify'
- 'logrotate' 'linhes-templates' 'linhes-theme' 'mlocate' 'moreutils' 'ncdu' 'python-dateutil' 'python-pytz'
- 'python-tzlocal' 'openssh' 'pacman-contrib' 'rsyslog' 'ttf-overlock' 'wget' 'x11vnc'
+ 'logrotate' 'linhes-templates' 'linhes-theme' 'mlocate' 'moreutils' 'ncdu' 'pacman-contrib'
+ 'plasma-x11-session' 'python-dateutil' 'python-pytz' 'python-tzlocal' 'openssh'
+ 'rsyslog' 'ttf-overlock' 'wget' 'x11vnc'
'intel-media-driver' 'libva-intel-driver' 'pigz')
binfiles="add_storage.py balance_storage_groups.py empty_storage_groups.py remove_storage.py
checkXFSfrag.sh enableIRWake.sh idle.py lh_system_start.sh lh_notify-send
@@ -23,22 +24,22 @@ source=($binfiles
'lh_mtc.cron' 'paccache.cron' 'flatpak_update.cron' 'xfs_defrag.cron' 'pacman_orphans.cron'
'readme_is_xml' 'add_storage.readme' 'LinHES-release' 'lh_log_care.cron'
'79-cronie.hook' 'fstrim.hook' 'openssh.hook' 'plex_lib.conf' 'rsyslog.hook'
- '10-monitor.conf' '81-wol.rules' 'x11vnc.override.conf' 'lh_lighttpd.conf' 'lh_php.ini'
+ '10-monitor.conf' '81-wol.rules' '69-hdparm.rules' 'x11vnc.override.conf' 'lh_lighttpd.conf' 'lh_php.ini'
'system-sudo.rules' 'linhes-profile.sh' 'lh_sqlserver.cnf' 'lh_restart_needed.hook'
'lh_system_start.sh.desktop' 'rc6_mce.toml' 'recordings.cron' 'rsyslog.mythtv.conf')
-sha256sums=('e6eaa2fb4819fa60cb05b4d2e7328d2914af3a73028a735ec4d56e7ece33ecc0'
+sha256sums=('1fb11c7f472df9e3066866301962c2678b80c2fbd988dc34db022d51e1101a42'
'8ae6de3d0ff8e777aeea56f74f38676080142148ac3a32f828462d85c39e7cf7'
- 'bf72f364dfd6a694774ae0c998a737bf551057a2b3b427f58418854d3e9c785b'
+ '79a3fe8622dbc5351316c0e36c26f8443334fcf8eea324cf0a0efe0e4c2c1a93'
'ff261f41efec8a9963f9f59100cbe75f015028a2ed3a863ce0cb473f2ebb7b76'
'8b54c31b8efde3917f603c5307bebb0a2a00239ad9a983c2f5d8120003256449'
'ae34515e144830f424d3bd3f6b1b446892d62beed20bca6f0fb19b0bbb779f27'
- '9e52a21e9d0f3f993b819587256a1cd57dca04451d5f2d0fd76667b1d3f860f1'
- 'fbd1640106b3d9356452625753a6f1974e0be905b9f4732a1287b3905806cba8'
+ 'a79edfeb88b90a8f5538a159b39ba235caba8c6d6b2a39a20faa3ae0301b770b'
+ '050d7d44b1636a298ae020807e64637b40d39b4c52eb2f9661fe30090e66cee3'
'1c36e4fdf41c1063e0a127ce4a90fbdef19879c381a87f622d7399ca931560cc'
'87875d9e5f5ce18208f419698ce69b6bcbcd08955a57a4a13940e715af58b787'
'192bfff1b8d46e0ebb969618847d9993aba3b1b578053c8d701dad9f9e758f86'
'a523388ffdc6f30f2dd2ef4803b21bded8a35bfded499dc66b786adec71840a3'
- '6ea7f807a29631e33629da14e7ca6481310f0416c5d6f8fb415a76fa90fb9b76'
+ 'eec03b722449a55e589eb79aade87e9b2a964e82b8fe23723016b640a079de2a'
'91bdec992bb2c933e15625c181f2195c402060b879168ebf35944cb064c904b9'
'5cacfdd02833e5a3130d765573e772e6bd5030336ba86239c5e4db5ffa36fc69'
'd51253c207d3315997d7122cb774c6d0fc38975c33e66bf416f0b1b95cf86e5b'
@@ -76,11 +77,12 @@ sha256sums=('e6eaa2fb4819fa60cb05b4d2e7328d2914af3a73028a735ec4d56e7ece33ecc0'
'6c42b2920c6a37bf3dd05755b9e3fdd80137708cc55a7d1bef2234c17dff0349'
'09b9c1b2ee6a5bbe48c5f3755ad64628487b60a4eb6734efb292cefdb74fb657'
'efc2a04b67ea76661157e154228d4b58ae2e1b652f8ce41bc001a5a863d13573'
+ '7571e230ab4cf2a1285fdb9762d87d350ea350ce820e5806143b402aa1ea37e0'
'67d0cb111d47609de4c60b84dc617fc817fdf092763fbd0cef270b5ee650d702'
'023cba18580819018413608ec055d5ff8166b69525c32aa728ad1ecd7cf00aca'
'dae799f09a076e0f573ea516bc357f56f2fd3aa8e35ec0cf54b6b62282960ee0'
'aa1d831f25317a9cb8d7e9a7d7b6d51c8d03bd5b69f3bec27bea7644ca38fe9a'
- 'cf884bad5caab9d5901b88b0ef41e3a39ea0b7a4614b8d14707d79941c899cbf'
+ '2553c3a877b6b18eed8269d5d78bd5676cd52fa5ead5b99a02f42bd134f12040'
'01416dadeb34ca8b18bb7326113672b3888b16a60133d501d48610d23b74d1eb'
'197ff4bb3c1cafcb197268cac335f1f75ae26873aca5833d62cc51fade85176c'
'0b9868a563036c81f8fdb8ab8bbad51934aca2a07e9d7634e24214791afda8e2'
@@ -156,6 +158,7 @@ package() {
chmod 750 ${pkgdir}/etc/sudoers.d/
#udev rules
+ install -Dm0644 "${srcdir}/69-hdparm.rules" "${pkgdir}/etc/udev/rules.d/69-hdparm.rules"
install -Dm0644 "${srcdir}/81-wol.rules" "${pkgdir}/etc/udev/rules.d/81-wol.rules"
#disable dpms
diff --git a/linhes/linhes-system/add_storage.py b/linhes/linhes-system/add_storage.py
index cc6feb5..318e77b 100755
--- a/linhes/linhes-system/add_storage.py
+++ b/linhes/linhes-system/add_storage.py
@@ -5,7 +5,7 @@
#Disks that are mounted, in fstab, size < 5000 bytes, optical or
#have already been seen will not be presented as an option.
#
-# Version 2.0.2
+# Version 2.1.0
import dbus
import pickle
@@ -147,7 +147,8 @@ class disk_device:
return True
def get_is_device(self):
- match = re.search(r'part\d+$', self.device_file_path)
+ #match = re.search(r'part\d+$', self.device_file_path)
+ match = re.search(r'part\d+$', self.device_id)
if match is None:
return True
else:
@@ -214,6 +215,20 @@ class disk_device:
if i[1] in mp:
fstype = i[2]
break
+
+ loop = True
+ prompt = '''
+ Format disk with what filesystem (xfs/ext4)?:'''
+
+ while loop:
+ str1 = input(prompt)
+
+ if str1 in ['xfs','ext4']:
+ loop = False
+ fstype=str1
+ break
+ print("\n")
+
return fstype
def lookup_format(self):
diff --git a/linhes/linhes-system/empty_storage_groups.py b/linhes/linhes-system/empty_storage_groups.py
index c181242..c36437e 100755
--- a/linhes/linhes-system/empty_storage_groups.py
+++ b/linhes/linhes-system/empty_storage_groups.py
@@ -1,6 +1,6 @@
#!/usr/bin/python
-import argparse, glob, operator, os, random, shutil, subprocess, sys, signal
+import argparse, glob, operator, os, random, shutil, subprocess, sys, signal, time
shouldQuit = False
def getFreeSpaceForDir(dir):
@@ -24,6 +24,8 @@ def sizeof_fmt(num, suffix='B'):
return "%.1f %s%s" % (num, 'Yi', suffix)
def signal_handler(signal, frame):
+ if isBusy:
+ sys.exit(0)
print("\nWill quit when file has been moved.\nMoving File...")
global shouldQuit
shouldQuit = True
@@ -163,11 +165,19 @@ if __name__ == '__main__':
print("Check Only option was used. No files were moved.")
shouldQuit = True
else:
- print("------------------------------------------------")
- print("Checking System Status...")
- if subprocess.call(["/usr/bin/python", "/usr/bin/idle.py", "-s"]):
- print(" System is busy. The file will not be moved.")
- sys.exit()
+ global isBusy
+ isBusy = True
+ while isBusy:
+ if shouldQuit:
+ sys.exit(0)
+ print("------------------------------------------------")
+ print("Checking System Status...")
+ if subprocess.call(["/usr/bin/python", "/usr/bin/idle.py", "-s"]):
+ print(" System is busy. The file will not be moved.")
+ print(" Waiting 5 minutes before trying again.")
+ time.sleep(300)
+ else:
+ isBusy = False
print("Moving File...")
try:
shutil.move(filePathToMove, leastFull[0])
diff --git a/linhes/linhes-system/idle.py b/linhes/linhes-system/idle.py
index 3f4b3bc..4b2db1e 100755
--- a/linhes/linhes-system/idle.py
+++ b/linhes/linhes-system/idle.py
@@ -1,7 +1,8 @@
#!/usr/bin/python
-import argparse, os, re, subprocess, sys, time
+import argparse, os, re, requests, subprocess, sys, time
from datetime import datetime, date, timedelta
+import xml.etree.ElementTree as ET
def msg(cmdargs,msg):
if cmdargs.silent is False:
@@ -237,24 +238,31 @@ def mythfe_check(cmdargs,cursor,mythDB):
for i in frontends:
try:
+ URL = f"http://{i[0]}:6547/Frontend/GetStatus"
msg(cmdargs," Checking %s's mythfrontend status..." %i)
- frontend = mythDB.getFrontend(''.join(i))
+ response = requests.get(URL, timeout=3)
+ root = ET.fromstring(response.text)
+ # Find the current location and state in the State element
+ state_element = root.find('State')
+ if state_element is not None:
+ location = state_element.find(".//String[Key='currentlocation']/Value")
+ state = state_element.find(".//String[Key='state']/Value")
+
if ( cmdargs.runningfe ):
msg(cmdargs," %s's mythfrontend is RUNNING." %i)
return False
- location = frontend.sendQuery('Location')
- if location == "standbymode":
+ if location is not None and location.text == "standbymode":
msg(cmdargs," %s's mythfrontend is in Standby Mode." %i)
continue
- if ( location.startswith('Playback ') ):
+ if state is not None and state.text.startswith('Watching'):
msg(cmdargs," %s's mythfrontend is PLAYING." %i)
return False
else:
msg(cmdargs," %s's mythfrontend is NOT playing." %i)
- if '.xml' in location or 'mainmenu' in location:
+ if location is not None and '.xml' in location.text or 'mainmenu' in location.text:
msg(cmdargs," %s's mythfrontend is in MENUS." %i)
else:
#FE is not in menus, so it must be active in a plugin
diff --git a/linhes/linhes-system/lh_system_backup_job b/linhes/linhes-system/lh_system_backup_job
index 6d16596..e45d6ea 100755
--- a/linhes/linhes-system/lh_system_backup_job
+++ b/linhes/linhes-system/lh_system_backup_job
@@ -27,7 +27,7 @@ do
fi
done
-if [ `mountpoint -q $BACKUPDISK 2> /dev/null` ]; then
+if ! mountpoint -q "$BACKUPDISK"; then
echo " The system doesn't have a second drive. Backup skipped."
exit $backup_status
fi
diff --git a/linhes/linhes-system/lh_system_start.sh b/linhes/linhes-system/lh_system_start.sh
index d1bd2b9..b783535 100755
--- a/linhes/linhes-system/lh_system_start.sh
+++ b/linhes/linhes-system/lh_system_start.sh
@@ -40,7 +40,7 @@ function bashrc_setup(){
function nanorc_setup(){
sudo sed -i 's/# set tabsize.*/set tabsize 4/' /etc/nanorc
sudo sed -i 's/# set tabstospaces.*/set tabstospaces/' /etc/nanorc
- sudo sed -i 's/# include "\/usr\/share\/nano\/\*.nanorc"/include "\/usr\/share\/nano\/\*.nanorc"/' /etc/nanorc
+ sudo sed -i 's/.*\/usr\/share\/nano\/\*.nanorc.*/include \/usr\/share\/nano\/\*.nanorc/' /etc/nanorc
}
function storage_scan(){
diff --git a/linhes/linhes-system/linhes-profile.sh b/linhes/linhes-system/linhes-profile.sh
index df98315..f558673 100644
--- a/linhes/linhes-system/linhes-profile.sh
+++ b/linhes/linhes-system/linhes-profile.sh
@@ -5,7 +5,7 @@ export MYTHTV_AIRPLAY="1"
if [ -f /etc/systemconfig ]; then
SystemType=$(grep SystemType= /etc/systemconfig | cut -d '"' -f 2)
fi
-if [ ! $SystemType = "FrontendOnly" ]; then
+if [[ ! $SystemType == *"Only" ]]; then
if [ x$MYTH_RUN_STATUS = x ]; then
MYTHCONFDIR=/usr/share/mythtv /usr/bin/lh_myth_status.py
fi