mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 00:41:09 +02:00
update and rename migration script; execute migration script before loading config
Origin commit data
------------------
Branch: ni/coolstream
Commit: dceffe31f0
Author: vanhofen <vanhofen@gmx.de>
Date: 2018-11-22 (Thu, 22 Nov 2018)
Origin message was:
------------------
- update and rename migration script; execute migration script before loading config
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -1,10 +1,8 @@
|
|||||||
|
|
||||||
installdir = $(CONFIGDIR)
|
installdir = $(CONFIGDIR)
|
||||||
install_DATA = flash.start
|
|
||||||
|
|
||||||
#NI
|
install_DATA = \
|
||||||
install_DATA += \
|
flash.start \
|
||||||
ni-migration.sh \
|
migration.sh \
|
||||||
movieplayer.start \
|
movieplayer.start \
|
||||||
movieplayer.end \
|
movieplayer.end \
|
||||||
recording.start \
|
recording.start \
|
||||||
@@ -14,7 +12,7 @@ install_DATA += \
|
|||||||
|
|
||||||
install-data-hook:
|
install-data-hook:
|
||||||
chmod 0755 $(DESTDIR)$(CONFIGDIR)/flash.start
|
chmod 0755 $(DESTDIR)$(CONFIGDIR)/flash.start
|
||||||
chmod 0755 $(DESTDIR)$(CONFIGDIR)/ni-migration.sh
|
chmod 0755 $(DESTDIR)$(CONFIGDIR)/migration.sh
|
||||||
chmod 0755 $(DESTDIR)$(CONFIGDIR)/movieplayer.start
|
chmod 0755 $(DESTDIR)$(CONFIGDIR)/movieplayer.start
|
||||||
chmod 0755 $(DESTDIR)$(CONFIGDIR)/movieplayer.end
|
chmod 0755 $(DESTDIR)$(CONFIGDIR)/movieplayer.end
|
||||||
chmod 0755 $(DESTDIR)$(CONFIGDIR)/recording.start
|
chmod 0755 $(DESTDIR)$(CONFIGDIR)/recording.start
|
||||||
|
24
data/neutrino-scripts/migration.sh
Normal file
24
data/neutrino-scripts/migration.sh
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
cd /var/tuxbox/config
|
||||||
|
if [ -e neutrino.conf ]; then
|
||||||
|
# remove NG leftovers
|
||||||
|
sed -i 's|ng_netfs_\(.*\)|netfs_\1|' neutrino.conf
|
||||||
|
|
||||||
|
# webradio_usr.xml was moved
|
||||||
|
sed -i "s|/var/tuxbox/config/webradio_usr.xml|/var/tuxbox/webradio/webradio_usr.xml|" neutrino.conf
|
||||||
|
mkdir -p /var/tuxbox/webradio/
|
||||||
|
if [ -e /var/tuxbox/config/webradio_usr.xml -a ! -e /var/tuxbox/webradio/webradio_usr.xml ]; then
|
||||||
|
mv /var/tuxbox/config/webradio_usr.xml /var/tuxbox/webradio/
|
||||||
|
fi
|
||||||
|
|
||||||
|
# webtv_usr.xml was moved
|
||||||
|
sed -i "s|/var/tuxbox/config/webtv_usr.xml|/var/tuxbox/webtv/webtv_usr.xml|" neutrino.conf
|
||||||
|
mkdir -p /var/tuxbox/webtv/
|
||||||
|
if [ -e /var/tuxbox/config/webtv_usr.xml -a ! -e /var/tuxbox/webtv/webtv_usr.xml ]; then
|
||||||
|
mv /var/tuxbox/config/webtv_usr.xml /var/tuxbox/webtv/
|
||||||
|
fi
|
||||||
|
|
||||||
|
sort neutrino.conf > neutrino.sort
|
||||||
|
mv neutrino.sort neutrino.conf
|
||||||
|
fi
|
@@ -1,9 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
cd /var/tuxbox/config
|
|
||||||
if [ -e neutrino.conf ]; then
|
|
||||||
sed -i 's|ng_netfs_\(.*\)|netfs_\1|' neutrino.conf
|
|
||||||
|
|
||||||
sort neutrino.conf > neutrino.sort
|
|
||||||
mv neutrino.sort neutrino.conf
|
|
||||||
fi
|
|
@@ -43,7 +43,7 @@
|
|||||||
#define MOVIEPLAYER_END_SCRIPT CONFIGDIR "/movieplayer.end"
|
#define MOVIEPLAYER_END_SCRIPT CONFIGDIR "/movieplayer.end"
|
||||||
#define NEUTRINO_ENTER_FLASH_SCRIPT CONFIGDIR "/flash.start"
|
#define NEUTRINO_ENTER_FLASH_SCRIPT CONFIGDIR "/flash.start"
|
||||||
#define NEUTRINO_APP_START_SCRIPT CONFIGDIR "/neutrino.start"
|
#define NEUTRINO_APP_START_SCRIPT CONFIGDIR "/neutrino.start"
|
||||||
#define NEUTRINO_NI_MIGRATION_SCRIPT CONFIGDIR "/ni-migration.sh" //NI
|
#define NEUTRINO_CONF_MIGRATION_SCRIPT CONFIGDIR "/migration.sh"
|
||||||
|
|
||||||
#define NEUTRINO_SCAN_SETTINGS_FILE CONFIGDIR "/scan.conf"
|
#define NEUTRINO_SCAN_SETTINGS_FILE CONFIGDIR "/scan.conf"
|
||||||
#define NEUTRINO_PARENTALLOCKED_FILE DATADIR "/neutrino/.plocked"
|
#define NEUTRINO_PARENTALLOCKED_FILE DATADIR "/neutrino/.plocked"
|
||||||
|
@@ -338,6 +338,11 @@ int CNeutrinoApp::loadSetup(const char * fname)
|
|||||||
char cfg_value[20]; //NI mode_icons_flag
|
char cfg_value[20]; //NI mode_icons_flag
|
||||||
int erg = 0;
|
int erg = 0;
|
||||||
|
|
||||||
|
// execute migration script before loading configfile
|
||||||
|
puts("[neutrino.cpp] executing " NEUTRINO_CONF_MIGRATION_SCRIPT ".");
|
||||||
|
if (my_system(NEUTRINO_CONF_MIGRATION_SCRIPT) != 0)
|
||||||
|
perror(NEUTRINO_CONF_MIGRATION_SCRIPT " failed");
|
||||||
|
|
||||||
configfile.clear();
|
configfile.clear();
|
||||||
// load settings; setup defaults
|
// load settings; setup defaults
|
||||||
if (!configfile.loadConfig(fname))
|
if (!configfile.loadConfig(fname))
|
||||||
@@ -5685,9 +5690,4 @@ void CNeutrinoApp::migrateConfig(const char *fname)
|
|||||||
configfile.deleteKey(from);
|
configfile.deleteKey(from);
|
||||||
}
|
}
|
||||||
/* more complex migration, including converting values etc. could be done here */
|
/* more complex migration, including converting values etc. could be done here */
|
||||||
|
|
||||||
//NI
|
|
||||||
puts("[neutrino.cpp] executing " NEUTRINO_NI_MIGRATION_SCRIPT ".");
|
|
||||||
if (my_system(NEUTRINO_NI_MIGRATION_SCRIPT) != 0)
|
|
||||||
perror(NEUTRINO_NI_MIGRATION_SCRIPT " failed");
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user