summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/LinHES-config/systemconfig.sh
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core-testing/LinHES-config/systemconfig.sh')
-rwxr-xr-xabs/core-testing/LinHES-config/systemconfig.sh96
1 files changed, 61 insertions, 35 deletions
diff --git a/abs/core-testing/LinHES-config/systemconfig.sh b/abs/core-testing/LinHES-config/systemconfig.sh
index 3aac497..948137a 100755
--- a/abs/core-testing/LinHES-config/systemconfig.sh
+++ b/abs/core-testing/LinHES-config/systemconfig.sh
@@ -41,6 +41,17 @@ else
fi
+function cp_and_log () {
+ if [ -e $1 ]
+ then
+ echo "copying $1 to $2"
+ cp -rfp "$1" "$2"
+ else
+ echo "$1 is not present, skipping..."
+ fi
+
+}
+
#-----------------------------------------------------
@@ -55,14 +66,14 @@ function setupmysql {
# dbhost=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'|head -n1`
dbhost=`ifconfig | grep -C1 $default_interface| grep -v $default_interface | cut -d: -f2 | awk '{ print $1}'`
sed -e "s/^dbhost=.*$/dbhost=\"$dbhost\"/" /etc/systemconfig >/tmp/systemconfig.old
- cp /tmp/systemconfig.old ${BASE}/etc/systemconfig
+ cp_and_log /tmp/systemconfig.old ${BASE}/etc/systemconfig
##logic to change master_serverip and backend_serverip in db
${BASE}${MV_ROOT}/bin/restore_default_settings.sh -c BECONFIG -s master -a $dbhost
else
dbhost=$MYTHIP
sed -e "s/^dbhost=.*$/dbhost=\"$dbhost\"/" /etc/systemconfig >/tmp/systemconfig.old
- cp /tmp/systemconfig.old ${BASE}/etc/systemconfig
+ cp_and_log /tmp/systemconfig.old ${BASE}/etc/systemconfig
#logic to change dbhost in db
${BASE}${MV_ROOT}/bin/restore_default_settings.sh -c BECONFIG -s master -a $dbhost
fi
@@ -96,7 +107,7 @@ function setupmysql {
rm ${BASE}${MV_ROOT}/bin/mythtv/.mythtv/mysql.txt
if [ -f ${BASE}/home/mythtv/templates/mysql.txt ]
then
- cp ${BASE}/home/mythtv/templates/mysql.txt $MYSQLTXT
+ cp_and_log ${BASE}/home/mythtv/templates/mysql.txt $MYSQLTXT
fi
chmod 755 $MYSQLTXT
@@ -151,7 +162,7 @@ ln -s "/usr/share/zoneinfo/$timezone" ${BASE}/etc/localtime
# echo CLOCK="UTC" > ${BASE}/etc/conf.dclock
# echo CLOCK_SYSTOCH="yes" >> ${BASE}/etc/conf.d/clock
# echo TIMEZONE="$timezone" >> ${BASE}/etc/conf.d/clock
-cp $TEMPLATES/rc.conf /etc/rc.conf
+cp_and_log $TEMPLATES/rc.conf /etc/rc.conf
}
@@ -173,7 +184,7 @@ function setupreceiver {
Hauppauge) echo "setup hauppauge reciever (lirc_i2c)"
sed -i -e '/.*#lirc/d' ${BASE}/etc/modules.mythvantage
echo "lirc_i2c #lirc" >> ${BASE}/etc/modules.mythvantage
- cp $TEMPLATES/modules/lirc_i2c.conf ${BASE}/etc/modprobe.d/lirc_i2c.conf
+ cp_and_log $TEMPLATES/modules/lirc_i2c.conf ${BASE}/etc/modprobe.d/lirc_i2c.conf
rmmod lirc_i2c 2>/dev/null
load-modules-mythvantage.sh
;;
@@ -198,7 +209,7 @@ function setupremote {
do
cat $i >> ${BASE}/etc/lircd.conf
done
- cp -f lircrc* $BASE/etc/lircrc 2> /dev/null
+ cp -f lircrc* $BASE/etc/lircrc 2> /dev/null
if [ -f $TEMPLATES/LCD/$LCDtype/lircrc ]
then
cat $TEMPLATES/LCD/$LCDtype/lircrc >> /etc/lircrc
@@ -258,7 +269,7 @@ function setupevrouter {
x ) echo "empty evrouter"
;;
* ) echo "setup evrouter for $EvrouterConfig "
- cp $TEMPLATES/evrouter/$EvrouterConfig /etc/evrouter.cfg
+ cp_and_log $TEMPLATES/evrouter/$EvrouterConfig /etc/evrouter.cfg
daemon_add="evrouter Xvfb $daemon_remove"
;;
@@ -296,7 +307,7 @@ function setupLCD {
if [ -f $TEMPLATES/LCD/$LCDtype/LCDd.conf ]
then
- cp -f $TEMPLATES/LCD/$LCDtype/LCDd.conf /etc
+ cp_and_log $TEMPLATES/LCD/$LCDtype/LCDd.conf /etc
# install="lcdproc $install"
daemon_add="lcdd $daemon_add"
load-modules-mythvantage.sh
@@ -316,7 +327,7 @@ function setupLCD {
function scrubnfs {
- cp /etc/fstab $TEMPLATES/fstab.conf.template
+ cp_and_log /etc/fstab $TEMPLATES/fstab.conf.template
grep -v nfs $TEMPLATES/fstab.conf.template > ${BASE}/etc/fstab
}
@@ -341,8 +352,11 @@ function setupncidclient
}
function setupnciddaemon {
- cp -f /etc/ncid/ncidd.conf $TEMPLATES/ncidd.conf.template
- sed -e "s/.*set ttyport.*$/set ttyport = \/dev\/$nciddSerialPort /" $TEMPLATES/ncidd.conf.template >${BASE}/etc/ncid/ncidd.conf
+ if [ x$Runncidd = x1 ]
+ then
+ cp_and_log /etc/ncid/ncidd.conf $TEMPLATES/ncidd.conf.template
+ sed -e "s/.*set ttyport.*$/set ttyport = \/dev\/$nciddSerialPort /" $TEMPLATES/ncidd.conf.template >${BASE}/etc/ncid/ncidd.conf
+ fi
}
@@ -454,12 +468,14 @@ then
fi
for i in $remove
do
- echo "-----------$i --------------"
- grep -q $i $PKGBLACKLIST
- if [ $? = 1 ]
+ if [ ! x$i = xnone ]
then
- pacman -Q $i 2>/dev/null
- #VAR=`pacman -Q $i 2>&1 `
+ echo "-----------$i --------------"
+ grep -q $i $PKGBLACKLIST
+ if [ $? = 1 ]
+ then
+ pacman -Q $i 2>/dev/null
+ #VAR=`pacman -Q $i 2>&1 `
if [ $? = 0 ]
then
if [ $i = "mythweb$postfix" ]
@@ -471,31 +487,35 @@ fi
echo removed $i
fi
fi
- else
- echo "$i is black listed"
+ else
+ echo "$i is black listed"
+ fi
fi
done
- # fi
+
for i in $install
do
- echo "-----------$i --------------"
- grep -q $i $PKGBLACKLIST
- if [ $? = 1 ]
+ if [ ! x$i = xnone ]
then
- pacman -Q $i 2>/dev/null
- #VAR=`pacman -Q $i 2>&1 `
- # echo $VAR |grep -vq error:
+ echo "-----------$i --------------"
+ grep -q $i $PKGBLACKLIST
+ if [ $? = 1 ]
+ then
+ pacman -Q $i 2>/dev/null
+ #VAR=`pacman -Q $i 2>&1 `
+ # echo $VAR |grep -vq error:
- if [ ! $? = 0 ]
- then
- pacman --noconfirm -Sf $i
- echo installed $i
- else
- echo "$i already installed"
- fi
- else
- echo "$i is black listed"
+ if [ ! $? = 0 ]
+ then
+ pacman --noconfirm -Sf $i
+ echo installed $i
+ else
+ echo "$i already installed"
+ fi
+ else
+ echo "$i is black listed"
+ fi
fi
done
}
@@ -942,7 +962,13 @@ function reloadfe(){
then
killall -9 mythlcdserver
fi
- kill -s USR1 $PID
+ if [ x = x$PID ]
+ then
+ echo "Mythfrontend not running, will not reload"
+ else
+ kill -s USR1 $PID
+ fi
+ exit 0
}