Merge branch 'master' of github.com:OpenELEC/OpenELEC.tv

This commit is contained in:
Stephan Raue 2012-03-12 23:02:01 +01:00
commit e120c30211
14 changed files with 73 additions and 27 deletions

View File

@ -25,8 +25,9 @@
LOCKDIR="/var/lock/"
LOCKFILE="transmission.disabled"
mkdir -p "$LOCKDIR"
touch "$LOCKDIR/$LOCKFILE"
if [ "$(pidof transmission-daemon)" ];then
mkdir -p "$LOCKDIR"
touch "$LOCKDIR/$LOCKFILE"
killall -9 transmission-daemon
fi

View File

@ -64,6 +64,5 @@ mkdir -p $ADDON_HOME
break
fi
$ADDON_BIN $TVHEADEND_ARG &>$LOG_FILE
sleep 1
done &
fi

View File

@ -27,8 +27,9 @@ LOCKFILE="tvheadend.disabled"
ADDON_BIN="tvheadend"
mkdir -p "$LOCKDIR"
touch "$LOCKDIR/$LOCKFILE"
if [ "$(pidof $ADDON_BIN)" ];then
mkdir -p "$LOCKDIR"
touch "$LOCKDIR/$LOCKFILE"
killall $ADDON_BIN
fi

View File

@ -33,21 +33,17 @@ case "$1" in
tvheadend.stop
for module in $REMOVE_MODULES ; do
rmmod -w $module
done
done
fi
;;
thaw|resume)
if [ -f "$LOCKDIR/$LOCKFILE" ];then
for module in $REMOVE_MODULES ; do
modprobe $module
done
progress "Restarting HTS TVHeadend for wakeup..."
xbmc-send --host=127.0.0.1 -a "XBMC.RunScript(service.multimedia.hts-tvheadend)" &
fi
for module in $REMOVE_MODULES ; do
modprobe $module
done
progress "Restarting HTS TVHeadend for wakeup..."
xbmc-send --host=127.0.0.1 -a "XBMC.RunScript(service.multimedia.hts-tvheadend)" &
;;
*) exit $NA
;;
esac

View File

@ -25,9 +25,10 @@
LOCKDIR="/var/lock/"
LOCKFILE="vdr.disabled"
mkdir -p "$LOCKDIR"
touch "$LOCKDIR/$LOCKFILE"
if [ "$(pidof vdr.bin)" ];then
mkdir -p "$LOCKDIR"
touch "$LOCKDIR/$LOCKFILE"
killall vdr.bin
fi

View File

@ -26,11 +26,10 @@
LOCKDIR="/var/lock/"
LOCKFILE="oscam.disabled"
# use "$(pidof)" instead of $(pidof). otherwise 'if' statement will fail
# because oscam spawns at least one 'extra' process
mkdir -p "$LOCKDIR"
touch "$LOCKDIR/$LOCKFILE"
if [ "$(pidof oscam)" ];then
mkdir -p "$LOCKDIR"
touch "$LOCKDIR/$LOCKFILE"
killall -9 oscam
fi

View File

@ -25,8 +25,9 @@
LOCKDIR="/var/lock/"
LOCKFILE="dcron.disabled"
mkdir -p "$LOCKDIR"
touch "$LOCKDIR/$LOCKFILE"
if [ "$(pidof crond)" ]; then
mkdir -p "$LOCKDIR"
touch "$LOCKDIR/$LOCKFILE"
killall -9 crond
fi

View File

@ -23,8 +23,9 @@
LOCKDIR="/var/lock/"
LOCKFILE="pcscd.disabled"
mkdir -p "$LOCKDIR"
touch "$LOCKDIR/$LOCKFILE"
if [ "$(pidof pcscd.bin)" ];then
mkdir -p "$LOCKDIR"
touch "$LOCKDIR/$LOCKFILE"
killall -9 pcscd.bin
fi

View File

@ -26,6 +26,9 @@
<setting id="NET2_SECURITY" value="NONE" />
<setting id="NET2_SSID" value="" />
<setting id="SAMBA_START" value="true" />
<setting id="SAMBA_SECURITY" value="false" />
<setting id="SAMBA_USERNAME" value="openelec" />
<setting id="SAMBA_PASSWORD" value="openelec" />
<setting id="UPDATE_AUTO" value="manual" />
<setting id="X11_KEYMAP" value="us" />
<setting id="X11_KEYMAP2" value="" />

View File

@ -36,5 +36,8 @@
<string id="5000">Samba</string>
<string id="5010">Boot</string>
<string id="5011">Start Samba at boot</string>
<string id="5012">Use Samba Passwords</string>
<string id="5013">Samba Username</string>
<string id="5014">Samba Password</string>
</strings>

View File

@ -67,5 +67,8 @@
<setting label="5010" type="lsep"/>
<setting type="sep" />
<setting id="SAMBA_START" type="bool" label="5011" default="true" />
<setting id="SAMBA_SECURITY" type="bool" label="5012" default="false" enable="eq(-1,true)"/>
<setting id="SAMBA_USERNAME" type="text" label="5013" default="openelec" enable="eq(-1,true) + eq(-2,true)"/>
<setting id="SAMBA_PASSWORD" type="text" option="hidden" label="5014" default="openelec" enable="eq(-2,true)+ eq(-3,true)"/>
</category>
</settings>

View File

@ -111,6 +111,7 @@ make bin/libsmbclient.so
if [ "$SAMBA_SERVER" = yes ]; then
make bin/smbd
make bin/nmbd
make bin/smbpasswd
fi
mkdir -p $SYSROOT_PREFIX/usr/lib

View File

@ -29,6 +29,7 @@ if [ "$SAMBA_SERVER" = "yes" ]; then
mkdir -p $INSTALL/usr/bin
cp $PKG_BUILD/source3/bin/smbd $INSTALL/usr/bin
cp $PKG_BUILD/source3/bin/nmbd $INSTALL/usr/bin
cp $PKG_BUILD/source3/bin/smbpasswd $INSTALL/usr/bin
mkdir -p $INSTALL/etc/samba
cp $PKG_DIR/config/smb.conf $INSTALL/etc/samba

View File

@ -35,13 +35,49 @@
SMB_USERCONF="/storage/.config/samba.conf"
SMB_DEFCONF="/etc/samba/smb.conf"
SMB_CONF="/var/run/smb.conf"
mkdir -p /var/run
if [ -f $SMB_USERCONF ]; then
SMB_ARG="--configfile=$SMB_USERCONF"
cp $SMB_USERCONF $SMB_CONF
else
SMB_ARG="--configfile=$SMB_DEFCONF"
cp $SMB_DEFCONF $SMB_CONF
fi
# only letters & numbers permitted for username & password
SAMBA_USERNAME=`echo $SAMBA_USERNAME | sed "s/[^a-zA-Z0-9]//g;"`
SAMBA_PASSWORD=`echo $SAMBA_PASSWORD | sed "s/[^a-zA-Z0-9]//g;"`
if [ "$SAMBA_SECURITY" == "true" -a ! "$SAMBA_USERNAME" == "" -a ! "$SAMBA_PASSWORD" == "" ] ; then
# username map: first line makes sure plain root does not work all the time
# processing continues, so if user chooses root as username, second line overrides the first
# this is done always in case user uses passwords in userconf.
# many thanks to viljoviitanen for this
echo -e "$SAMBA_PASSWORD\n$SAMBA_PASSWORD" | smbpasswd -s -a root >/dev/null 2>&1
echo -e "nobody = root\nroot = $SAMBA_USERNAME" > /var/run/samba.map
# set public = no
sed -e 's|^.[ \t]*.public.=.*| public = no |' $SMB_CONF > $SMB_CONF.tmp && \
mv $SMB_CONF.tmp $SMB_CONF
# remove username map (if any in userconfig)
sed -e 's|^.[ \t]*.username map.=.*||' $SMB_CONF > $SMB_CONF.tmp && \
mv $SMB_CONF.tmp $SMB_CONF
# set security = share, add username map
sed -e 's|^.[ \t]*.security.=.*| security = user\n username map = /var/run/samba.map|' $SMB_CONF > $SMB_CONF.tmp && \
mv $SMB_CONF.tmp $SMB_CONF
else
# set public = yes
sed -e 's|^.[ \t]*.public.=.*| public = yes |' $SMB_CONF > $SMB_CONF.tmp && \
mv $SMB_CONF.tmp $SMB_CONF
# remove username map (if any in userconfig)
sed -e 's|^.[ \t]*.username map.=.*||' $SMB_CONF > $SMB_CONF.tmp && \
mv $SMB_CONF.tmp $SMB_CONF
# set security = share
sed -e 's|^.[ \t]*.security.=.*| security = share|' $SMB_CONF > $SMB_CONF.tmp && \
mv $SMB_CONF.tmp $SMB_CONF
fi
SMB_ARG="--configfile=$SMB_CONF"
mkdir -p /var/log/samba
nmbd --daemon $SMB_ARG > /dev/null 2>&1
smbd --daemon $SMB_ARG > /dev/null 2>&1