summaryrefslogtreecommitdiffstats
path: root/linhes/linhes-system/lh_system_start.sh
diff options
context:
space:
mode:
Diffstat (limited to 'linhes/linhes-system/lh_system_start.sh')
-rwxr-xr-xlinhes/linhes-system/lh_system_start.sh37
1 files changed, 32 insertions, 5 deletions
diff --git a/linhes/linhes-system/lh_system_start.sh b/linhes/linhes-system/lh_system_start.sh
index a74805a..24c35d5 100755
--- a/linhes/linhes-system/lh_system_start.sh
+++ b/linhes/linhes-system/lh_system_start.sh
@@ -2,12 +2,19 @@
. /etc/profile
#. /etc/systemconfig
-SystemType=Masterbackend
+#SystemType=Masterbackend
function msg(){
/usr/bin/notify-send --app-name="LinHES" --icon=dialog-information "$1" "$2"
}
+function check_installer_user(){
+ if [[ "$(whoami)" = 'km' ]]; then
+ echo "Running lh_system_start as installer user km. Exiting."
+ exit 1
+ fi
+}
+
function applyUIsettings(){
cp /usr/share/linhes/templates/plasma-org.kde.plasma.desktop-appletsrc ~/.config/
#restart plasma
@@ -55,7 +62,10 @@ function storage_scan(){
function install_lh_apps(){
#install programs that are not needed on the iso
- sudo pacman -Syyy --noconfirm firefox glances mythtv ncdu x11vnc
+ msg "Installing apps..."
+ sudo pacman -Syyy --noconfirm firefox glances mythtv mythplugins-mytharchive mythplugins-mythmusic mythplugins-mythweb ncdu x11vnc
+ status=$?
+ [ $status -eq 1 ] && msg "Could not install apps. Check internet connection." && exit 1
}
function first_configure(){
@@ -67,12 +77,28 @@ function first_configure(){
nanorc_setup
bashrc_setup
x11vnc_setup
+ SystemType=$(kdialog --title "LinHES System Type" --combobox "Select the LinHES System Type: " "MasterBackend" "FrontendOnly" --default "MasterBackend")
#apply settings for specific system types
- if [ ! $SystemType = "Frontend_only" ]; then
- # only run mythfilldatabase for masterbackends
+ msg "Setup as $SystemType"
+ if [ ! $SystemType = "FrontendOnly" ]; then
+ # create media directory structure
+ sudo mkdir -p /data/storage/disk0
+ sudo create_media_dirs.sh /data/storage/disk0
+ # setup DB
+ sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
+ sudo systemctl enable --now mariadb.service
+ sudo mariadb -u root < /usr/share/linhes/templates/db/permissions.sql
+ mysql_tzinfo_to_sql /usr/share/zoneinfo | sudo mysql -u root mysql
+ # run mythtv-setup
+ #export DISPLAY=:0
+ mythtv-setup
+ # need to run twice for default db install/upgrade
+ mythtv-setup
+ sudo systemctl enable --now mythbackend.service
+ # run mythfilldatabase
#nice -n 19 mythfilldatabase --quiet &
- msg "Guide data is being loaded." "Until this completes some shows will appear as unknown in the program guide."
+ #msg "Guide data is being loaded." "Until this completes some shows will appear as unknown in the program guide."
else
msg "Frontend Only"
#Frontend_only cmds
@@ -84,6 +110,7 @@ function first_configure(){
#-------MAIN-------
+check_installer_user
first_configure
/usr/bin/enableIRWake.sh &
storage_scan