summaryrefslogtreecommitdiff
path: root/install-debian.sh
diff options
context:
space:
mode:
authorAndreas Brachold <vdr07@deltab.de>2007-11-17 15:59:51 +0000
committerAndreas Brachold <vdr07@deltab.de>2007-11-17 15:59:51 +0000
commit77f9f2cfd5656e4f5b2407915ca7122ec2e28b0a (patch)
treec38698b1ff5a702f33a33871b3fc96dfc2a54b50 /install-debian.sh
parentd10b12c4b91ae3ca74dc796b763ce6b1a954e2cc (diff)
downloadxxv-77f9f2cfd5656e4f5b2407915ca7122ec2e28b0a.tar.gz
xxv-77f9f2cfd5656e4f5b2407915ca7122ec2e28b0a.tar.bz2
* update install script, to be more compatibility
Diffstat (limited to 'install-debian.sh')
-rwxr-xr-xinstall-debian.sh53
1 files changed, 24 insertions, 29 deletions
diff --git a/install-debian.sh b/install-debian.sh
index 0b5009b..2a50a9e 100755
--- a/install-debian.sh
+++ b/install-debian.sh
@@ -6,25 +6,15 @@
XXVSOURCE=`pwd`
-lastchar()
-{
- # return the last character of a string in $rval
- if [ -z "$1" ]; then
- # empty string
- rval=""
- return
- fi
- # wc puts some space behind the output this is why we need sed:
- numofchar=`echo -n "$1" | wc -c | sed 's/ //g' `
- # now cut out the last char
- rval=`echo -n "$1" | cut -b $numofchar`
-}
+if [ ! -e /usr/share/man/man1 ] ; then
+ echo 'Install Manpage'
+ cp doc/xxvd.1 /usr/share/man/man1
+fi
-echo 'Install Manpage'
-cp doc/xxvd.1 /usr/share/man/man1
-
-echo 'Logrotate'
-cp etc/logrotate.d/xxvd /etc/logrotate.d/xxvd
+if [ ! -e /etc/logrotate.d/xxvd ] ; then
+ echo 'Logrotate'
+ cp etc/logrotate.d/xxvd /etc/logrotate.d/xxvd
+fi
if [ ! -e /usr/bin/vdr2jpeg ] ; then
echo 'install vdr2jpeg'
@@ -70,18 +60,23 @@ echo 'start mysql server'
echo 'create Database'
cat contrib/create-database.sql | mysql -u root
-echo 'DB connectstring write in config'
-echo '[General]' >> ~/.xxvd.cfg
-echo 'DSN=DBI:mysql:database=xxv;host=localhost;port=3306' >> ~/.xxvd.cfg
-echo 'PWD=xxv' >> ~/.xxvd.cfg
-echo 'USR=xxv' >> ~/.xxvd.cfg
+if [ ! -e "~/.xxvd.cfg" ]; then
+ echo 'DB connectstring write in config'
+ echo '[General]' >> ~/.xxvd.cfg
+ echo 'DSN=DBI:mysql:database=xxv;host=localhost;port=3306' >> ~/.xxvd.cfg
+ echo 'PWD=xxv' >> ~/.xxvd.cfg
+ echo 'USR=xxv' >> ~/.xxvd.cfg
+fi
-echo 'create Startscript'
-sed -e 's/FOLDER=\".+?\"/FOLDER=\"$XXVSOURCE\"/' etc/xxvd > /etc/init.d/xxvd
-chmod 775 /etc/init.d/xxvd
-RVV=`runlevel`
-lastchar "$RVV"
-ln -s /etc/init.d/xxvd "/etc/rc$rval.d/S90xxvd"
+if [ ! -e "/etc/init.d/xxvd" ]; then
+ echo 'create Startscript'
+ sed -e 's/FOLDER=\".+?\"/FOLDER=\"$XXVSOURCE\"/' etc/xxvd > /etc/init.d/xxvd
+ chmod a+x /etc/init.d/xxvd
+ RVV=`runlevel | cut -d " " -f 2`
+ if [ ! -e "/etc/rc$RVV.d/S90xxvd" ]; then
+ ln -s /etc/init.d/xxvd "/etc/rc$RVV.d/S90xxvd"
+ fi
+fi
echo 'Start XXV'
/etc/init.d/xxvd restart