FHEM/lib added

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@2390 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2012-12-29 17:21:04 +00:00
parent 305b6c3bc9
commit 9d12ce997c
4 changed files with 34 additions and 31 deletions

View File

@ -9,25 +9,25 @@ sleep 1
echo "########################### Extracting fhem.tar.gz ###################"
cd $root
rm -rf fhem.OLD
if test -d fhem; then
rm -rf fhem.OLD
mv fhem fhem.OLD
fi
gzip -cd /var/fhem.tar.gz | tar xf -
# Save files from the AVM Style installation
if test -f fhem.OLD/opt/etc/fhem.cfg; then
if test -f fhem.OLD/etc/fhem.cfg; then
echo "########################### Converting chroot style config ###########"
export LD_LIBRARY_PATH=$home/lib
export PERL5LIB=$home/lib/perl5/site_perl/5.12.2/mips-linux:$home/lib/perl5/site_perl/5.12.2:$home/lib/perl5/5.12.2/mips-linux:$home/lib/perl5/5.12.2
cp fhem.OLD/opt/etc/fhem.cfg fhem
fhem/perl -pi -e 's,/opt,$root,g;
s,fhem/share,fhem,;
cp fhem.OLD/etc/fhem.cfg fhem
fhem/perl -pi -e 's,/var/log/fhem,./log,g;
s,/usr/share/fhem,.,;
s,^#define autocreate,define autocreate,;
s,^#attr autocreate,attr autocreate,;
s,ttyACM(.)(@\d+)?,ttyACM$1\@38400,;' fhem/fhem.cfg
mv fhem.OLD/opt/fhem/log/* fhem/log
mv fhem.OLD/var/log/fhem/* fhem/log
fi
# Save files from our old version
@ -40,11 +40,6 @@ if test -f fhem.OLD/fhem.cfg; then
fi
chown -R boxusr80:root $home
if test -d fhem.OLD; then
echo "########################### Deleting the old directory ###############"
rm -rf fhem.OLD
fi
cat /var/flash/debug.cfg > /var/nvi.tmp
grep -q fhem /var/nvi.tmp
r=$?

View File

@ -37,10 +37,11 @@ rm -rf $fw
echo Packing again
cd var/fhem
cat >> fhem.cfg << 'EOF'
attr WEB basicAuth {use FritzBoxUtils;;FB_checkPw("localhost","$password") }
attr WEBphone basicAuth {use FritzBoxUtils;;FB_checkPw("localhost","$password") }
attr WEBtablet basicAuth {use FritzBoxUtils;;FB_checkPw("localhost","$password") }
attr telnetPort globalpassword {use FritzBoxUtils;;FB_checkPw("localhost","$password") }
#FB_checkPw does not for FB-OS > 5.22
#attr WEB basicAuth {use FritzBoxUtils;;FB_checkPw("localhost","$password") }
#attr WEBphone basicAuth {use FritzBoxUtils;;FB_checkPw("localhost","$password") }
#attr WEBtablet basicAuth {use FritzBoxUtils;;FB_checkPw("localhost","$password") }
#attr telnetPort globalpassword {use FritzBoxUtils;;FB_checkPw("localhost","$password") }
EOF
cd ..

View File

@ -17,16 +17,23 @@ export PATH
export LD_LIBRARY_PATH=$home/lib
export PERL5LIB=$home/lib/perl5/site_perl/5.12.2/mips-linux:$home/lib/perl5/site_perl/5.12.2:$home/lib/perl5/5.12.2/mips-linux:$home/lib/perl5/5.12.2
# let FHEM run as user boxusr80
# add user fhem with uid of boxusr80
# add user fhem with uid of boxusr80/boxusr99 (== ftpuser)
# Comment/delete everything between START and END to run FHEM as root
## START:fhem-user
id fhem > /dev/null 2>&1
if [ "$?" -ne "0" ]; then
echo "user fhem does not exist. Adding it."
echo "fhem:any:1080:0:fhem:/home-not-used:/bin/sh" >>/var/tmp/passwd
# set files ownership
chown -R boxusr80 FHEM docs fhem.pl log fhem.cfg www
if test "$?" -ne "0"; then
grep -q 1099 /etc/passwd;
if test $? -eq "0"; then
echo "fhem:any:1099:0:fhem:/home-not-used:/bin/sh" >>/var/tmp/passwd
else
echo "fhem:any:1080:0:fhem:/home-not-used:/bin/sh" >>/var/tmp/passwd
fi
chown -R fhem FHEM docs log www
chown fhem . *
chown root dfu-programmer
chmod u+s dfu-programmer
fi
## END:fhem-user
perl fhem.pl fhem.cfg

View File

@ -25,8 +25,7 @@ system("mkdir -p fhemupdate");
system("svn update .");
die "SVN failed, exiting\n" if($?);
`cp fhem.pl fhem.pl.txt`;
`../copyfiles.sh`;
#################################
# Old style
@ -40,9 +39,9 @@ my @filelist = (
"www/images/default/.*.png",
"www/images/smallscreen/.*.png",
"www/pgm2/.*\.(js|css|svg)",
"docs/commandref.html",
"docs/faq.html",
"docs/HOWTO.html",
"docs/commandref(_..)?.html",
"docs/faq(_..)?.html",
"docs/HOWTO(_..)?.html",
"docs/fhem.*.png",
"docs/.*.jpg",
"../culfw/Devices/CUL/.*.hex",
@ -95,7 +94,6 @@ foreach my $f (sort keys %filetime) {
}
}
close FH;
NEWSTYLE:
for(my $loop = 0; $loop < 2; $loop++) {
@ -118,9 +116,9 @@ for(my $loop = 0; $loop < 2; $loop++) {
"www/images/dark/.*.png" => { type=>"fhem,", dir=>"www/pgm2"},
"www/images/default/.*" => { type=>"fhem,", dir=>"www/pgm2"},
"www/images/smallscreen/.*" => { type=>"fhem,", dir=>"www/pgm2"},
"docs/commandref.html" => { type=>"fhem,", dir=>"www/pgm2"},
"docs/faq.html" => { type=>"fhem,", dir=>"www/pgm2"},
"docs/HOWTO.html" => { type=>"fhem,", dir=>"www/pgm2"},
"docs/commandref(_..)?.html" => { type=>"fhem,", dir=>"www/pgm2"},
"docs/faq(_..)?.html" => { type=>"fhem,", dir=>"www/pgm2"},
"docs/HOWTO(_..)?.html" => { type=>"fhem,", dir=>"www/pgm2"},
"docs/fhem.*.png" => { type=>"fhem,", dir=>"www/pgm2"},
"docs/.*.jpg" => { type=>"fhem,", dir=>"www/pgm2"},
);
@ -228,3 +226,5 @@ my $rsyncopts="-a --delete --compress --verbose";
system("rsync $rsyncopts fhemupdate fhem.de:fhem");
system("rsync $rsyncopts fhemupdate2 fhem.de:fhem");
system("rsync $rsyncopts fhemupdate4/. fhem.de:fhem/fhemupdate4/svn");
system("scp docs/commandref.html docs/commandref_DE.html fhem.de:fhem");
system("scp CHANGED fhem.de:fhem");