[script] output current ip address to virtual usb as file

Here are software that related with Samsung C series TVs, applications, programs that will run in your TV or computer...:!:This forum is NOT FOR USER QUESTIONS or Problems.
Post Reply

User avatar
beatfreak
SamyGO Project Donor
Posts: 548
Joined: Tue Aug 23, 2011 9:03 am
Location: Hamburg
Contact:

[script] output current ip address to virtual usb as file

Post by beatfreak » Sun Aug 20, 2017 9:11 pm

if your TV is configured with DHCP to get its IP-address you have to look i your DHCP-Servers lease table to find the current IP of it.
the following init script creates an empty mp3 file in your virtual usb drive whose name is the current IP

Code: Select all

# cat /mtd_rwcommon/SamyGO/etc/init.d/99_98_touch_my_ip.init 
SpoilerShow

Code: Select all

#!/bin/busybox sh
#
#
. /dtv/SGO.env

case $1 in
    start)
        IP=`ifconfig eth0 |grep inet |cut -c -36`
        IP=`echo $IP |sed -e 's/ /_/g'`
        IP=`echo $IP |sed -e 's/:/_/g'`
        touch $MOUNT_PATH/debug/$IP.mp3
        ;;
    stop)
        rm -r $MOUNT_PATH/debug
        ;;
    restart)
        $0 stop && $0 start || exit 1
        ;;
    status)
        ls -l $MOUNT_PATH/debug
        ;;
    *)
    echo "Usage: $0 {start|stop|restart|status}" 1>&2
    exit 0
    ;;
esac
ToDo: deal with IPv6
Last edited by beatfreak on Fri Oct 27, 2017 5:52 pm, edited 3 times in total.
//UE40C6500 @ T-VALDEUC 3011 // rooted manual HotelMode style // PVR to NFS via 18MB on-the-fly sparse XFS //
FYI: you can close your ssh session with SamyGO with

Code: Select all

~.
If you can't fix it using dvct tape, you are not using enough dvct tape.

zoelechat
SamyGO Moderator
Posts: 7894
Joined: Fri Apr 12, 2013 7:32 pm
Location: France

Re: [script] output current ip address to virtual usb as file

Post by zoelechat » Sun Aug 20, 2017 9:53 pm

I tried to play mp3 in Winamp, not works :cry:
I do NOT receive any PM. Please use forum.

User avatar
beatfreak
SamyGO Project Donor
Posts: 548
Joined: Tue Aug 23, 2011 9:03 am
Location: Hamburg
Contact:

Re: [script] output current ip address to virtual usb as file

Post by beatfreak » Sun Aug 20, 2017 10:00 pm

beatfreak wrote:
Sun Aug 20, 2017 9:11 pm
creates an empty mp3 file
its not a bug, its a feature! (:

you think creating a folder instead of mp3 file will be more user-proof?
or generate playable mp3 with tts-engine?
//UE40C6500 @ T-VALDEUC 3011 // rooted manual HotelMode style // PVR to NFS via 18MB on-the-fly sparse XFS //
FYI: you can close your ssh session with SamyGO with

Code: Select all

~.
If you can't fix it using dvct tape, you are not using enough dvct tape.

zoelechat
SamyGO Moderator
Posts: 7894
Joined: Fri Apr 12, 2013 7:32 pm
Location: France

Re: [script] output current ip address to virtual usb as file

Post by zoelechat » Sun Aug 20, 2017 10:57 pm

Nah, just wanted to liven things up a bit ;)
I do NOT receive any PM. Please use forum.

User avatar
beatfreak
SamyGO Project Donor
Posts: 548
Joined: Tue Aug 23, 2011 9:03 am
Location: Hamburg
Contact:

Re: [script] output current ip address to virtual usb as file

Post by beatfreak » Mon Aug 21, 2017 12:10 am

maybe there is a way to create a still empty but valid mp3 file
or find any already existing mp3 file in firmware image and copy that to a tmpfs location
and put even more info in id3 tags that should be viewable with media player
//UE40C6500 @ T-VALDEUC 3011 // rooted manual HotelMode style // PVR to NFS via 18MB on-the-fly sparse XFS //
FYI: you can close your ssh session with SamyGO with

Code: Select all

~.
If you can't fix it using dvct tape, you are not using enough dvct tape.

User avatar
beatfreak
SamyGO Project Donor
Posts: 548
Joined: Tue Aug 23, 2011 9:03 am
Location: Hamburg
Contact:

Re: [script] output current ip address to virtual usb as file

Post by beatfreak » Fri Oct 27, 2017 5:51 pm

script updated, some fixes
looking for testers on other Series
//UE40C6500 @ T-VALDEUC 3011 // rooted manual HotelMode style // PVR to NFS via 18MB on-the-fly sparse XFS //
FYI: you can close your ssh session with SamyGO with

Code: Select all

~.
If you can't fix it using dvct tape, you are not using enough dvct tape.

Post Reply

Return to “[C] Software”