Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add preinstall and postinstall scripts to gracefully either intall or reinstall Myth. Makes sure that initial configuration of Myth's database (mythconverg) is done including time zone support.
- Loading branch information
1 parent
89b58fc
commit ee87964
Showing
3 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/sh | ||
|
||
# MythTV installer support, postinstall script | ||
# runs as root after installer successfully copies payload to destination | ||
# assume database installer package has initialized and started db server | ||
|
||
DB_BIN=@PREFIX@/lib/mariadb/bin | ||
|
||
echo $0 Starting | ||
echo make sure database has a config | ||
if [ ! -f @PREFIX@/etc/mariadb/my.cnf ] ; then | ||
cp @PREFIX@/share/mythtv/database/my.cnf @PREFIX@/etc/mariadb | ||
echo start/restart db for pick up our config | ||
if /bin/launchctl list "org.macports.mariadb-server" &> /dev/null; then | ||
echo Unload db server... | ||
/bin/launchctl unload "/Library/LaunchDaemons/org.macports.mariadb-server.plist" | ||
fi | ||
echo Load the db server | ||
/bin/launchctl load -w /Library/LaunchDaemons/org.macports.mariadb-server.plist | ||
fi | ||
|
||
echo MariaDB server may be starting... | ||
sleep 6 | ||
echo ...should be up now | ||
|
||
# Check mythconverg database | ||
if [ ! -d "/opt/local/var/db/mariadb/mythconverg" ] ; then | ||
echo Set up mythconverg db and mythtv user | ||
$DB_BIN/mysql -u root < @PREFIX@/share/mythtv/database/mythconverg_init.sql | ||
echo Add time zone support tables | ||
$DB_BIN/mysql_tzinfo_to_sql /usr/share/zoneinfo | $DB_BIN/mysql -u root mysql | ||
fi | ||
echo $0 Finished |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
# MythTV installer support, preinstall script | ||
# Note that all the preinstall scripts are run (as root), then the payload is 'shove'd into place | ||
# After that, all the postinstall scripts are run. | ||
# Script also runs in a sandbox with no access to /Private and other directories | ||
# note that launchctl requires sudo | ||
|
||
echo mythtv.28 preinstall script starting | ||
|
||
echo if backend loaded, unload before continuing install | ||
if /bin/launchctl list "org.mythtv.mythbackend" &> /dev/null; then | ||
/bin/launchctl unload "/Library/LaunchDaemons/org.mythtv.mythbackend.plist" | ||
echo ...backend now unloaded | ||
fi | ||
|
||
echo mythtv.28 preinstall script finished |