diff options
author | James Meyer <james.meyer@operamail.com> | 2010-04-03 21:17:40 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2010-04-03 21:17:40 (GMT) |
commit | 1e5530d500cd89303494c503cf2b6b04cf6ea708 (patch) | |
tree | 2691c8bb947f4b9342d74452d062187c13175f9f /abs/core-testing/LinHES-config | |
parent | 6ee95c24a4ffc57f8397f2cd15d3fa7474631510 (diff) | |
download | linhes_pkgbuild-1e5530d500cd89303494c503cf2b6b04cf6ea708.zip linhes_pkgbuild-1e5530d500cd89303494c503cf2b6b04cf6ea708.tar.gz linhes_pkgbuild-1e5530d500cd89303494c503cf2b6b04cf6ea708.tar.bz2 |
linhes-config, templates: add jumppoints to the list of saved settings
Diffstat (limited to 'abs/core-testing/LinHES-config')
-rw-r--r-- | abs/core-testing/LinHES-config/PKGBUILD | 43 | ||||
-rwxr-xr-x | abs/core-testing/LinHES-config/restore_default_settings.sh | 160 |
2 files changed, 90 insertions, 113 deletions
diff --git a/abs/core-testing/LinHES-config/PKGBUILD b/abs/core-testing/LinHES-config/PKGBUILD index 37d5f0a..12849ff 100644 --- a/abs/core-testing/LinHES-config/PKGBUILD +++ b/abs/core-testing/LinHES-config/PKGBUILD @@ -1,6 +1,6 @@ pkgname=LinHES-config pkgver=2.1 -pkgrel=34 +pkgrel=36 conflicts=(MythVantage-config MythVantage-config-dev LinHES-config-dev LinHes-config ) pkgdesc="Install and configure your system" depends=('bc' 'libstatgrab' 'mysql-python' 'expect' 'curl' 'dnsutils' 'parted' @@ -109,42 +109,7 @@ md5sums=('297441b8d85820698c19e7c0ad5a3dfe' '7a45287a07145fde5aa664583d4f6fba' 'f88d2fb88339a4bf8ec9217a3fbcdef7' '8ac1cfd2eca0f641737da0d0aca416a7' - 'd8a4a1699e04eed9ee69d58616069f33' - '4620f6f498ef4523398635cb0bd59425' - '06188493e5ed79cb501d3c5694dee8ca' - 'e459ed069317bccb20351f037a9df3d2' - '26ee0932243b79484b37eb8f6cf04cd4' - '6aff504ed5e860adc1b7317cd0780900' - '55fccb1da0417a896b724f7cfc32dd5a' - 'ab2aa42c2947148c2b1cac0ade6d1d55' - 'd429b59d3cfb37b0624c6a4a71a7c2c0' - 'a225143e3df6f56d451c2875e54ddbae' - '687555968d4ca688d8f95c8f13e1d8d4' - '3d1e4a119f38cff0498bf8a67e94e4b3' - '37401edf67296d3a4467ad178958d177' - 'ee7c8e1f025ce1527ecfffabafb26806' - '41b03fb1e0a9d9ae7588e3b813212772' - 'a9ffe72c3ede99d505fdc97572a7c256' - 'f1c98a4acb01d9284d192149914c1e18' - '65d93f15ac85adf8299552581789a731' - '4badc3c664c55f87396a473e6c14d4bc' - 'e2aa772fe0bf366e26eaaf663f9257bd' - 'fe5e31b833cc6707209e9d656b6eb53c' - 'd328d63eaa4252f3d4888476c79bbff6' - '23d0e12b7ca1cc6ea6b993c1d7ff20b9' - '88059ef8c4a2926bb6fde14d810e1336' - 'cf35353141b70145f3ee8b0bd852c9f1' - 'cf60e7ba4cf3467bb5539d5c51da61b6' - 'a63ff9ef5250965aeabc74bfa8e43981') -md5sums=('297441b8d85820698c19e7c0ad5a3dfe' - '1a4694fcd694b362c339bda781ed0f3e' - 'e36da536dd651ef182e7642337889e77' - '3baa23764e1b6bcb2d66d7d859096940' - 'd7a8cd4a0060399ae22e69f74e04eb07' - '7a45287a07145fde5aa664583d4f6fba' - 'f88d2fb88339a4bf8ec9217a3fbcdef7' - '8ac1cfd2eca0f641737da0d0aca416a7' - 'd8a4a1699e04eed9ee69d58616069f33' + 'c6c45a749a2808e70f101b697f571699' '4620f6f498ef4523398635cb0bd59425' '06188493e5ed79cb501d3c5694dee8ca' 'e459ed069317bccb20351f037a9df3d2' @@ -167,7 +132,7 @@ md5sums=('297441b8d85820698c19e7c0ad5a3dfe' 'fe5e31b833cc6707209e9d656b6eb53c' 'd328d63eaa4252f3d4888476c79bbff6' '23d0e12b7ca1cc6ea6b993c1d7ff20b9' - '88059ef8c4a2926bb6fde14d810e1336' + '857a831e8627727306208f0e776b1b98' 'cf35353141b70145f3ee8b0bd852c9f1' 'cf60e7ba4cf3467bb5539d5c51da61b6' 'a63ff9ef5250965aeabc74bfa8e43981') @@ -179,7 +144,7 @@ md5sums=('297441b8d85820698c19e7c0ad5a3dfe' '7a45287a07145fde5aa664583d4f6fba' 'f88d2fb88339a4bf8ec9217a3fbcdef7' '8ac1cfd2eca0f641737da0d0aca416a7' - 'd8a4a1699e04eed9ee69d58616069f33' + '9ae8d79f620c6d19973c55c32a921874' '4620f6f498ef4523398635cb0bd59425' '06188493e5ed79cb501d3c5694dee8ca' 'e459ed069317bccb20351f037a9df3d2' diff --git a/abs/core-testing/LinHES-config/restore_default_settings.sh b/abs/core-testing/LinHES-config/restore_default_settings.sh index dcf5e23..ffd4b0d 100755 --- a/abs/core-testing/LinHES-config/restore_default_settings.sh +++ b/abs/core-testing/LinHES-config/restore_default_settings.sh @@ -5,7 +5,7 @@ shopt -s -o nounset echo $@ >> /tmp/restore.out #TEMPLATES="/usr/share/templates/settings" TEMPLATES="$TEMPLATES/settings" -TABLES="settings keybindings" +TABLES="settings keybindings jumppoints" MYTHDBUSER=mythtv MYTHTVPASSWD=mythtv declare -r OPTSTRING="c:e:t:d:h:s:a:z:Ho" @@ -15,12 +15,12 @@ declare -i EVERYTHING=0 function CMD_DEFINE () { - #add override check + #add override check if [ x$Thistemplate = xsyssettings -a $OVERRIDE -eq 1 ] then - MYSQLCMD="mysql --local-infile -s -u$MYTHDBUSER -p$MYTHTVPASSWD -h$ovdbhost mythconverg -B --exec" - MYSQLCMD_C="mysql -u$MYTHDBUSER -p$MYTHTVPASSWD -h$ovdbhost mythconverg -B --exec" - MYSQLCMD_UPDATE_HOST="UPDATE settings set data='$oldhostname' where value='HostMyhostname' and hostname=\"$hostname\";" + MYSQLCMD="mysql --local-infile -s -u$MYTHDBUSER -p$MYTHTVPASSWD -h$ovdbhost mythconverg -B --exec" + MYSQLCMD_C="mysql -u$MYTHDBUSER -p$MYTHTVPASSWD -h$ovdbhost mythconverg -B --exec" + MYSQLCMD_UPDATE_HOST="UPDATE settings set data='$oldhostname' where value='HostMyhostname' and hostname=\"$hostname\";" else MYSQLCMD="mysql --local-infile -s -u$MYTHDBUSER -p$MYTHTVPASSWD -h$dbhost mythconverg -B --exec" MYSQLCMD_C="mysql -u$MYTHDBUSER -p$MYTHTVPASSWD -h$dbhost mythconverg -B --exec" @@ -32,21 +32,21 @@ function SQL_DEFINE () { thostname=`echo ${hostname}|tr -C [:alpha:] _` echo "Using $thostname for temp table postfix" - #$1 is the table name - if [ $1 = "settings" ] - then - ALTERSQL="Alter table temp_${1}_${thostname} add unique ( value )" - else - ALTERSQL=";" - fi + #$1 is the table name + if [ $1 = "settings" ] + then + ALTERSQL="Alter table temp_${1}_${thostname} add unique ( value )" + else + ALTERSQL=";" + fi CREATESQL="create table temp_${1}_${thostname} like $1;" - COPY_TMP_SQL="replace into temp_${1}_${thostname} (select * from $1 where hostname=\"$hostname\");" - INSERTSQL="LOAD DATA local INFILE '/tmp/$1.txt' REPLACE INTO TABLE temp_${1}_${thostname} FIELDS TERMINATED BY '\t';" + COPY_TMP_SQL="replace into temp_${1}_${thostname} (select * from $1 where hostname=\"$hostname\");" + INSERTSQL="LOAD DATA local INFILE '/tmp/$1.txt' REPLACE INTO TABLE temp_${1}_${thostname} FIELDS TERMINATED BY '\t';" #INSERTSQL="LOAD DATA local INFILE '$TEMPLATES/$Thistemplate/$1.txt' REPLACE INTO TABLE temp_${1}_${hostname} FIELDS TERMINATED BY '\t';" - DROPSQL="delete from $1 where hostname=\"$hostname\";" - COPY_BCK_SQL="replace into $1 (select * from temp_${1}_${thostname} where hostname=\"$hostname\");" - DROP_TABLE="Drop table temp_${1}_${thostname}" + DROPSQL="delete from $1 where hostname=\"$hostname\";" + COPY_BCK_SQL="replace into $1 (select * from temp_${1}_${thostname} where hostname=\"$hostname\");" + DROP_TABLE="Drop table temp_${1}_${thostname}" } function ARG_ERR() { @@ -101,8 +101,8 @@ do ARG_ERR Thistemplate=$OPTARG - if [ x$Thistemplate = x"syssettings" ] - then + if [ x$Thistemplate = x"syssettings" ] + then echo "template is syssettings" loadhost=false elif [ x$Thistemplate = x"hostsettings" ] @@ -128,13 +128,13 @@ do ARG_ERR if [ $OVERRIDE = 1 ] then - oldhostname=$hostname + oldhostname=$hostname hostname=$OPTARG else hostname=$OPTARG - fi + fi - ;; + ;; s) echo "$SWITCH" "$OPTARG" ARG_ERR SYSTEMTYPE=$OPTARG @@ -144,11 +144,11 @@ do IP_ADDRESS=$OPTARG ;; z) echo "$SWITCH" "$OPTARG" - ARG_ERR - ZIPCODE=$OPTARG + ARG_ERR + ZIPCODE=$OPTARG ;; - o) OVERRIDE=1 - ;; + o) OVERRIDE=1 + ;; esac done @@ -175,10 +175,10 @@ fi case $OPERATION in - restore) - #used to restore settings from syssettings - if [ -d $TEMPLATES/$Thistemplate ] - then + restore) + #used to restore settings from syssettings + if [ -d $TEMPLATES/$Thistemplate ] + then cd $TEMPLATES/$Thistemplate if [ $loadhost = false ] then @@ -213,38 +213,42 @@ case $OPERATION in $MYSQLCMD "$COPY_BCK_SQL" $MYSQLCMD "$DROP_TABLE " fi - else - echo "couldn't find $TEMPLATES/$Thistemplate" - fi - ;; + else + echo "couldn't find $TEMPLATES/$Thistemplate" + fi + ;; - save) + save) + if [ ! -d $TEMPLATES/$Thistemplate ] + then + mkdir -p $TEMPLATES/$Thistemplate + fi - if [ ! -d $TEMPLATES/$Thistemplate ] - then - mkdir -p $TEMPLATES/$Thistemplate - fi + cd $TEMPLATES/$Thistemplate + for i in $TABLES + do + EXTRACLAUSE="" + case $i in + settings) + EXTRACLAUSE="and not (value like \"BackendServerIP\") and not (value like \"locale\") order by value" + SQL="select value,data,'REPLACEME' as hostname from $i where hostname=\"$hostname\" "$EXTRACLAUSE" ;" + # SQL="select * from $i where hostname=\"$hostname\" "$EXTRACLAUSE" ;" + $MYSQLCMD_C "$SQL" > $TEMPLATES/$Thistemplate/$i.txt + ;; + keybindings) + SQL="select context,action,description,keylist,'REPLACEME' as hostname from $i where hostname=\"$hostname\" "$EXTRACLAUSE" ;" + $MYSQLCMD_C "$SQL" > $TEMPLATES/$Thistemplate/$i.txt + ;; + jumppoints) + SQL="select destination,description,keylist,'REPLACEME' as hostname from $i where hostname=\"$hostname\" "$EXTRACLAUSE" ;" + $MYSQLCMD_C "$SQL" > $TEMPLATES/$Thistemplate/$i.txt - cd $TEMPLATES/$Thistemplate - for i in $TABLES - do - EXTRACLAUSE="" - case $i in - settings) - EXTRACLAUSE="and not (value like \"BackendServerIP\") and not (value like \"locale\") order by value" - SQL="select value,data,'REPLACEME' as hostname from $i where hostname=\"$hostname\" "$EXTRACLAUSE" ;" - # SQL="select * from $i where hostname=\"$hostname\" "$EXTRACLAUSE" ;" - $MYSQLCMD_C "$SQL" > $TEMPLATES/$Thistemplate/$i.txt - ;; - keybindings) - SQL="select context,action,description,keylist,'REPLACEME' as hostname from $i where hostname=\"$hostname\" "$EXTRACLAUSE" ;" - $MYSQLCMD_C "$SQL" > $TEMPLATES/$Thistemplate/$i.txt - ;; - esac - # sed -e "s/$hostname/REPLACEME/g" $i > $i.txt && rm $i + ;; + esac + # sed -e "s/$hostname/REPLACEME/g" $i > $i.txt && rm $i - done - ;; + done + ;; load) @@ -253,22 +257,22 @@ case $OPERATION in do if [ -f $TEMPLATES/$i/settings.txt ] then - echo $i - for tablename in $TABLES + echo $i + for tablename in $TABLES do - #create table + #create table CREATESQL="create table IF NOT EXISTS ${tablename}_${i} like $tablename;" $MYSQLCMD_C "$CREATESQL" - #truncate table + #truncate table TRUNCATESQL="truncate ${tablename}_${i} " $MYSQLCMD_C "$TRUNCATESQL" - #load table - INSERTSQL="LOAD DATA local INFILE '$TEMPLATES/$i/$tablename.txt' REPLACE INTO TABLE ${tablename}_${i} FIELDS TERMINATED BY '\t';" + #load table + INSERTSQL="LOAD DATA local INFILE '$TEMPLATES/$i/$tablename.txt' REPLACE INTO TABLE ${tablename}_${i} FIELDS TERMINATED BY '\t';" $MYSQLCMD_C "$INSERTSQL" - #update_hostname - UPDATEHOSTNAMESQL="update ${tablename}_${i} set hostname='$i' ; " + #update_hostname + UPDATEHOSTNAMESQL="update ${tablename}_${i} set hostname='$i' ; " $MYSQLCMD_C "$UPDATEHOSTNAMESQL" - done + done else echo "couldn't find $TEMPLATES/$i/settings.txt template to load" @@ -286,6 +290,14 @@ case $OPERATION in $MYSQLCMD_C "$CREATESQL" CREATESQL="create table IF NOT EXISTS keybindings_user3 like keybindings;" $MYSQLCMD_C "$CREATESQL" + + CREATESQL="create table IF NOT EXISTS jumppoints_user1 like jumppoints;" + $MYSQLCMD_C "$CREATESQL" + CREATESQL="create table IF NOT EXISTS jumppoints_user2 like jumppoints;" + $MYSQLCMD_C "$CREATESQL" + CREATESQL="create table IF NOT EXISTS jumppoints_user3 like jumppoints;" + $MYSQLCMD_C "$CREATESQL" + done ;; @@ -302,14 +314,14 @@ case $OPERATION in if [ $SYSTEMTYPE = "slave" ] then $MYSQLCMD_C "delete from settings where value='BackendServerIP' and hostname=\"$hostname\";" - $MYSQLCMD_C "REPLACE INTO settings set data='${IP_ADDRESS}' , value='BackendServerIP' , hostname=\"$hostname\";" + $MYSQLCMD_C "REPLACE INTO settings set data='${IP_ADDRESS}' , value='BackendServerIP' , hostname=\"$hostname\";" fi ;; ZIP) - $MYSQLCMD_C "delete from settings where value='locale' and hostname=\"$hostname\";" - $MYSQLCMD_C "REPLACE INTO settings set data='$ZIPCODE' , value='locale' , hostname=\"$hostname\";" - $MYSQLCMD_C "delete from settings where value='MythMovies.ZipCode' and hostname=\"$hostname\";" - $MYSQLCMD_C "REPLACE INTO settings set data='$ZIPCODE', value='MythMovies.ZipCode' , hostname=\"$hostname\";" + $MYSQLCMD_C "delete from settings where value='locale' and hostname=\"$hostname\";" + $MYSQLCMD_C "REPLACE INTO settings set data='$ZIPCODE' , value='locale' , hostname=\"$hostname\";" + $MYSQLCMD_C "delete from settings where value='MythMovies.ZipCode' and hostname=\"$hostname\";" + $MYSQLCMD_C "REPLACE INTO settings set data='$ZIPCODE', value='MythMovies.ZipCode' , hostname=\"$hostname\";" ;; MUSICFRONT) ALSADEVICE @@ -325,7 +337,7 @@ case $OPERATION in $MYSQLCMD_C "delete from settings where value='MusicAudioDevice' and hostname=\"$hostname\";" $MYSQLCMD_C "REPLACE INTO settings set data='$SoundDevice', value='MusicAudioDevice' , hostname=\"$hostname\";" ;; - uhostname) + uhostname) #used when the hostname is changed. TABLES="settings capturecard keybindings storagegroup recorded" for i in $TABLES @@ -353,7 +365,7 @@ case $OPERATION in SQL="update settings set data='0' where value='Hostaccessuser' and hostname=\"$hostname\" ;" $MYSQLCMD_C "$SQL" ;; - esac + esac #SELECT * INTO OUTFILE 'data.txt' # FIELDS TERMINATED BY ',' |