Novell Home

HowTo: Create and Use Stomfi's Cool School Show Part 2

Novell Cool Solutions: Feature
By Stomfi

Digg This - Slashdot This

Updated: 15 Mar 2005
 

StomfiLearning to use Linux at Home and Work
Welcome to my ongoing series of HowTo articles designed to help Linux newbies get comfortable with Linux. Before trying any of these HowTos, take a few minutes to study the prerequisites so you can hit the ground running.
--Stomfi

Cool School Show is a multimedia presentation, editing, and review system for students to include their own school work in any field of endeavour for viewing and rating by other students in friendly competition.

The first part of this how to showed you all the windows used in the system. This second part shows you the objects and scripts that make it all work.

This series of pictures shows the objects on each window or card. These are buttons, labels, plain fields, scrollable fields, scrollable list fields, and images. You can see which ones have scripts and which window cards have them too, by the variable numbers to the right of the objects name.















You can leave out the field "DEBUG". These are used to get feedback when developing the application. Like when a shell script performs a function that doesn't return any values. For example, the line may say "put the shell of DOSHELL into DUNSHELL". You can read the output by saying 'put DUNSHELL into field "DEBUG"'.



This window has all the ratings radio buttons in horizontal lines, which are grouped under the name ending with "rate". Grouping radio buttons allows them to work so that only one in the line can be highlighted.

These are the RunRev scripts for the window cards except the add/edit show cards which shall be dealt with in the next how to.   (For more information about Runtime Revolution visit http://www.novell.com/coolsolutions/feature/1863.html)

Card SHENTRY

on openCard

   put ($HOME & "/SCOOL/bin/showlist.sh") into SHOWLIST

   put the shell of SHOWLIST into field "Showlist"

end openCard

Field Showlist

on mouseDown

   put the hilitedText of me into SELSHOW

   if SELSHOW <> empty

   then

      put ($HOME & "/SCOOL/bin/showselect.sh" && SELSHOW) into THISSHOW

      replace return with empty in THISSHOW

      put the shell of THISSHOW into DUNSHOW

   end if

end mouseDown

Button SSHOW

on mouseUp

   go card "ShowCard"

end mouseUp

Button VRATE

on mouseUp

   go card "VRATE"

end mouseUp

Button SADD

on mouseUp

   #Add a global so that we can return to Addshow from sub cards without

   #resetting its fields and parameters

   global NEWTIME

   put "YES" into NEWTIME

   go card "Addshow"

end mouseUp

Button NETWORK

on mouseUp

   go card "SNET"

end mouseUp

Card ShowCard

on openCard

   #Display the current show named in $HOME/SCOOL/info/current.txt

   #This file contains a one line reference to the show which is available on the user's computer

   #by the getshow shell script. The references to the first display page are returned.

   put ($HOME & "/SCOOL/bin/getshow.sh 1") into DOSHOW

   replace return with empty in DOSHOW

   put the shell of DOSHOW into GETSHOW

   put GETSHOW into field "DEBUG"

   put line 1 of GETSHOW into SHEAD

   put line 2 of GETSHOW into STEXT

   put line 3 of GETSHOW into SPIC

   put line 4 of GETSHOW into SMUSIC

   #create global references for the page buttons

   global SPNUM

   put line 5 of GETSHOW into SPNUM

   #Create a global reference for the current page number

   global SPAGE

   put 1 into SPAGE

   #Load up the card

   open file SHEAD for read

   read from file SHEAD until EOF

   close file SHEAD

   put it into field "SHOWHEAD"

   open file STEXT for read

   read from file STEXT until EOF

   close file STEXT

   if STEXT <> empty

   then

      put it into field "SHOWTEXT"

   end if

   if SPIC <> empty

   then

      set the filename of image "SHOWPIC" to SPIC

   end if

   global THISMUS

   put empty into THISMUS

   if SMUSIC <> empty

   then

      put SMUSIC into THISMUS

   end if

   #end of load

end openCard

Button BACK

on mouseUp

   #Get the show references

   #Current page number

   global SPAGE

   #This contains the number of pages

   global SPNUM

   if SPAGE > 1

   then

      subtract 1 from SPAGE

      #Repeat the load commands

      put ($HOME & "/SCOOL/bin/getshow.sh" && SPAGE) into DOSHOW

      put the shell of DOSHOW into GETSHOW

      put line 1 of GETSHOW into SHEAD

      put line 2 of GETSHOW into STEXT

      put line 3 of GETSHOW into SPIC

      put line 4 of GETSHOW into SMUSIC
  
      #Load up the card

      open file SHEAD for read

      read from file SHEAD until EOF

      close file SHEAD

      put it into field "SHOWHEAD"

      open file STEXT for read

      read from file STEXT until EOF

      close file STEXT

      if STEXT <> empty

      then

         put it into field "SHOWTEXT"

      end if

      if SPIC <> empty

      then

         set the filename of image "SHOWPIC" to SPIC

      end if

      #Stop and change the music

      global THISMUS

      if THISMUS <> empty

      then

         #could be some playing from previous page

         put ($HOME & "/SCOOL/bin/stopsnd.sh") into STOPSND

         replace return with empty in STOPSND

         put the shell of STOPSND into DUNSTOP

      end if

      put empty into THISMUS

      if SMUSIC <> empty

      then

         put SMUSIC into THISMUS

      end if

      #end of load

   else

      go card "SHENTRY"

   end if

end mouseUp

Button QUIT

on mouseUp

   go to card "SHREVIEW"

end mouseUp

Button NEXT

on mouseUp

   #Get the show references

   #Current page number

   global SPAGE

   #This contains the number of pages

   global SPNUM

   if SPAGE < SPNUM

   then

      add 1 to SPAGE

      #Repeat the load commands

      put ($HOME & "/SCOOL/bin/getshow.sh" && SPAGE) into DOSHOW

      put the shell of DOSHOW into GETSHOW

      put line 1 of GETSHOW into SHEAD

      put line 2 of GETSHOW into STEXT

      put line 3 of GETSHOW into SPIC

      put line 4 of GETSHOW into SMUSIC

      #Load up the card

      open file SHEAD for read

      read from file SHEAD until EOF

      close file SHEAD

      put it into field "SHOWHEAD"

      open file STEXT for read

      read from file STEXT until EOF

      close file STEXT

      if STEXT <> empty

      then

         put it into field "SHOWTEXT"

      end if

      if SPIC <> empty

      then

         set the filename of image "SHOWPIC" to SPIC

      end if

      #Stop and change the music

      global THISMUS

      if THISMUS <> empty

      then

         #could be some playing from previous page

         put ($HOME & "/SCOOL/bin/stopsnd.sh") into STOPSND

         replace return with empty in STOPSND

         put the shell of STOPSND into DUNSTOP

      end if

      put empty into THISMUS

      if SMUSIC <> empty

      then

         put SMUSIC into THISMUS

      end if

      #end of load

   else

      go card "SHREVIEW"

   end if

end mouseUp

Button MUSIC

on mouseUp

   global THISMUS

   if THISMUS <> empty

   then

      #Play the music at 50% volume

      put the shell of ("aumix -v50") into SETMUS

      put ($HOME & "/SCOOL/bin/playsnd.sh" && THISMUS) into PLAYMUS

      replace return with empty in PLAYMUS

      put the shell of PLAYMUS into MUSPLAY

   end if

end mouseUp

Button MPLUS

on mouseUp

   put ($HOME & "/SCOOL/bin/increase.sh") into PLUSMUS

   replace return with empty in PLUSMUS

   put the shell of PLUSMUS into DUNPLUS

end mouseUp

Button MMINUS

on mouseUp

   put ($HOME & ?/SCOOL/bin/increase.sh?) into MINIMUS

   replace return with empty in MINIMUS

   put the shell of MINIMUS into DUNMINI

end mouseUp

Card SHREVIEW

on openCard

   global THISSHOW

   put ($HOME & "/SCOOL/info/current.txt") into CURSHOW

   put the shell of ("cat" && CURSHOW) into THISSHOW

   put THISSHOW into field "SRNAME"

   set the hilitedButton of group "entrate" to 1

   set the hilitedButton of group "textrate" to 1

   set the hilitedButton of group "picrate" to 1

   set the hilitedButton of group "sndrate" to 1

   set the hilitedButton of group "relrate" to 1

   global ENTRATE

   put 1 into ENTRATE

   global TEXTRATE

   put 1 into TEXTRATE

   global PICRATE

   put 1 into PICRATE

   global SNDRATE

   put 1 into SNDRATE

   global RELRATE

   put 1 into RELRATE

end openCard

Radio Button ent1

on mouseUp

   global ENTRATE

   put 1 into ENTRATE

end mouseUp

All the other radio button scripts are the same except for the number put into the RATE and the name of the RATE depending which line it is.

Button DONE

on mouseUp

   global ENTRATE

   global TEXTRATE

   global PICRATE

   global SNDRATE

   global RELRATE

   global THISSHOW

   put ($HOME & "/SCOOL/bin/dorate.sh" && quote & THISSHOW & quote && ENTRATE && TEXTRATE && PICRATE && SNDRATE && RELRATE) into DORATE

   replace return with empty in DORATE

   put the shell of DORATE into DUNRATE

   go card "SHENTRY"

end mouseUp

Card VRATE

on openCard

   put ($HOME & "/SCOOL/bin/ratings.sh") into DORATS

   put the shell of DORATS into DUNRATS

   put DUNRATS into field "SRATS"

end openCard

Button DONE

on mouseUp

   go card "SHENTRY"

end mouseUp

Card SNET

on openCard

   #Test the connection and set a flag if the Network Library server is up

   global NETSTATUS

   put "DOWN" into NETSTATUS

   put ($HOME & "/SCOOL/bin/netstat.sh") into HAVENET

   replace return with empty in HAVENET

   put the shell of HAVENET into NETSTATUS

   replace return with empty in NETSTATUS

   if NETSTATUS = "UP"

   then

      put ($HOME & "/SCOOL/bin/netshows.sh") into NETSHOWS

      replace return with empty in NETSHOWS

      put the shell of NETSHOWS into field "NSHOWLIST"

      put ($HOME & "/SCOOL/bin/showlist.sh") into SHOWLIST

      replace return with empty in SHOWLIST

      put the shell of SHOWLIST into field "AVSHOWS"

   else

      put "Network not Available" into field "NSHOWLIST"

      put "Network not Available" into field "AVSHOWS"

   end if

end openCard

Button SRGET

on mouseUp

   global NETSTATUS

   if NETSTATUS = "UP"

   then

      put ($HOME & "/SCOOL/bin/getrat.sh") into GETRAT

      replace return with empty in GETRAT

      put the shell of GETRAT into DUNPUT

   end if

end mouseUp

Field NSHOWLIST

on mouseDown

   global NETSTATUS

   if NETSTATUS = "UP"

   then

      put the hilitedText of me into THISNSHOW

      put ($HOME & "/SCOOL/bin/getnshow.sh" && quote & THISNSHOW & quote) into GETNSHOW

      replace return with empty in GETNSHOW

      put the shell of GETNSHOW into DUNGET

      put ($HOME & "/SCOOL/bin/showlist.sh") into SHOWLIST

      replace return with empty in SHOWLIST

      put the shell of SHOWLIST into field "AVSHOWS"

   end if

end mouseDown

Field AVSHOWS

on mouseDown

   global NETSTATUS

   if NETSTATUS = "UP"

   then

      put the hilitedText of me into THISLSHOW

      put ($HOME & "/SCOOL/bin/putnshow.sh" && quote & THISLSHOW & quote) into PUTNSHOW

      replace return with empty in PUTNSHOW

      put the shell of PUTNSHOW into DUNPUT

      put ($HOME & "/SCOOL/bin/netshows.sh") into NETLIST

      replace return with empty in NETLIST

      put the shell of NETLIST into field "NSHOWLIST"

   end if

end mouseDown

Button DONE

on mouseUp

   go card "SHENTRY"

end mouseUp

Now for the shell scripts that the RunRev scripts refer to in order.

#!/bin/bash

#showlist.sh

#

# Copyright Stomfi (C) 2005

# This program is free software;

# you can redistribute it and/or modify it under the terms of the

# GNU General Public License as published by the Free Software Foundation;

# either version 2 of the License, or any later version.

#

# This program is distributed in the hope that it will be useful,

# but WITHOUT ANY WARRANTY; without even the implied warranty of

# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

# GNU General Public License for more details.

#

# You should have received a copy of the GNU General Public License

# along with this program; if not, write to the Free Software

# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

#

#Return names of files in library without extension

SFILES=`ls $HOME/SCOOL/library/*`

for F in $SFILES

do

   SFNAME=`basename $F | cut -d"." -f1`

   echo "$SFNAME"

done


#!/bin/bash

#showselect.sh showname

#

#put the show name into $HOME/SCOOL/info/current.txt

#

# Copyright Stomfi (C) 2005

# This program is free software;

# you can redistribute it and/or modify it under the terms of the

# GNU General Public License as published by the Free Software Foundation;

# either version 2 of the License, or any later version.

#

# This program is distributed in the hope that it will be useful,

# but WITHOUT ANY WARRANTY; without even the implied warranty of

# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

# GNU General Public License for more details.

#

# You should have received a copy of the GNU General Public License

# along with this program; if not, write to the Free Software

# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

#

echo "$1" > $HOME/SCOOL/info/current.txt


#!/bin/bash

#getshow.sh pagenumber

#

#echo page parameters to standard output

#

# Copyright Stomfi (C) 2005

# This program is free software;

# you can redistribute it and/or modify it under the terms of the

# GNU General Public License as published by the Free Software Foundation;

# either version 2 of the License, or any later version.

#

# This program is distributed in the hope that it will be useful,

# but WITHOUT ANY WARRANTY; without even the implied warranty of

# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

# GNU General Public License for more details.

#

# You should have received a copy of the GNU General Public License

# along with this program; if not, write to the Free Software

# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

#

#Set the root directory

SROOT="$HOME/SCOOL"

#read the file current in SCOOL/info which gives the current show name

CSHOW=`cat $SROOT/info/current.txt`

CURSHOW="$SROOT/show/$CSHOW"

#if this is page 1 directory shouldn't exist as library copy may have changed

#so delete any existing directory and extract from the library

#The same thing goes if CURSHOW doesn't exist

#Send the standard error to the bottomless pit /dev/null

#as we don't want these messages interfering with the needed output list

#

ISEXIST=`ls $CURSHOW 2> /dev/null`

if [ $1 -eq 1 -o ${#ISEXIST} -lt 1 ]

then

   #Send standard error to standard output to /dev/null

   if [ ${#ISEXIST} -gt 0 ]

   then

      #Must be page 1 so delete it

      rm -rf $CURSHOW 2>&1 > /dev/null

   fi

   unzip $SROOT/library/$CSHOW.zip -d $SROOT/show 2>&1 > /dev/null

fi

#

#Get the page stuff from the extracted show

HEADER="$CURSHOW/header.txt"

#List the files in CURSHOW one line for each filename, and count them

NUMPAGES=`ls -1d $CURSHOW/*| wc -l`

#Subtract 1 for the header file to give the number of page directories

let NUMPAGES=($NUMPAGES - 1)

#Set the active page directory

PAGEDIR="$CURSHOW/$1"

#Check the active page directory to see if each file exists or echo a

#null string ("") so that the receiving function gets an ordered list of lines

ISTEXTFILE=`ls $PAGEDIR/text.txt 2> /dev/null`

if [ ${#ISTEXTFILE} -gt 0 ]

then

    TEXTFILE="$PAGEDIR/text.txt"

else

   TEXTFILE=""

fi

ISPICFILE=`ls $PAGEDIR/pic.* 2> /dev/null`

if [ ${#ISPICFILE} -gt 0 ]

then

   PICFILE="$ISPICFILE"

else

   PICFILE=""

fi

ISSNDFILE=`ls $PAGEDIR/snd.* 2> /dev/null`

if [ ${#ISSNDFILE} -gt 0 ]

then

   SNDFILE="$ISSNDFILE"

else

   SNDFILE=""

fi

#echo the results back to the calling function

echo "$HEADER"

echo "$TEXTFILE"

echo "$PICFILE"

echo "$SNDFILE"

echo "$NUMPAGES"


#!/bin/bash

#dorate.sh Showname entrate textrate picrate sndrate relrate

#

#Puts rating info into ratings file for showname and username

#

# Copyright Stomfi (C) 2005

# This program is free software;

# you can redistribute it and/or modify it under the terms of the

# GNU General Public License as published by the Free Software Foundation;

# either version 2 of the License, or any later version.

#

# This program is distributed in the hope that it will be useful,

# but WITHOUT ANY WARRANTY; without even the implied warranty of

# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

# GNU General Public License for more details.

#

# You should have received a copy of the GNU General Public License

# along with this program; if not, write to the Free Software

# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

#

RAT="$2#$3#$4#$5#$6"

#

USERSHOW="$USER#$1"

#

RFILE="$HOME/SCOOL/info/ratings.txt"

touch $RFILE

#

FINDLINE=`grep "$USERSHOW" $RFILE`

if [ ${#FINDLINE} -gt 1 ]

then

   #replace fields 3 to 7 of this line

   awk -F# -v USR="$USER" -v SHOW="$1" -v RATELINE="$RAT" \

   'BEGIN{OFS = "#"};{if($1 == USR && $2 == SHOW) {print USR, SHOW, RATELINE}\

   else {print $0}}' $RFILE > $HOME/SCOOL/info/trats.txt

   if [ -s $HOME/SCOOL/info/trats.txt ]

   then

      mv -f $HOME/SCOOL/info/trats.txt $RFILE

   else

      rm -f $HOME/SCOOL/info/trats.txt

   fi

else

   #add the line

   echo "$USERSHOW#$RAT" >> $RFILE

fi


#!/bin/bash

#ratings.sh 

#

#Reads each line and adds totals for each show and prints formatted output

#

# Copyright Stomfi (C) 2005

# This program is free software;

# you can redistribute it and/or modify it under the terms of the

# GNU General Public License as published by the Free Software Foundation;

# either version 2 of the License, or any later version.

#

# This program is distributed in the hope that it will be useful,

# but WITHOUT ANY WARRANTY; without even the implied warranty of

# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

# GNU General Public License for more details.

#

# You should have received a copy of the GNU General Public License

# along with this program; if not, write to the Free Software

# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

#

RFILE="$HOME/SCOOL/info/ratings.txt"

touch $RFILE

#

if [ -s $RFILE ]

then

   #Sort ratings file on showname field and format

   sort -t"#" -k2,2 $RFILE |\

   awk -F# 'BEGIN{OFS = "    ";

   print "NAME", "ENTERTAIN", "WRITINGS", "PICTURES", "SOUNDS", "RELEVENCE"};\

   {if(NR == 1)\

      {OLDN = $2;ERAT = $3;TRAT = $4;PRAT = $5;SRAT = $6;RRAT = $7}\

   else\

      {if($2 ~ OLDN)\

         {ERAT += $3;TRAT += $4;PRAT += $5;SRAT += $6;RRAT += $7}\

      };\

      {if($2 !~ OLDN)\

        {{print OLDN, ERAT, TRAT, PRAT, SRAT, RRAT};\

        {OLDN = $2;ERAT = $3;TRAT = $4;PRAT = $5;SRAT = $6;RRAT = $7}}\

      }\

   };\

   END{print OLDN, ERAT, TRAT, PRAT, SRAT, RRAT\

   }' 

fi


#!/bin/bash

#netstat.sh NIPS

#

# Copyright Stomfi (C) 2005

# This program is free software;

# you can redistribute it and/or modify it under the terms of the

# GNU General Public License as published by the Free Software Foundation;

# either version 2 of the License, or any later version.

#

# This program is distributed in the hope that it will be useful,

# but WITHOUT ANY WARRANTY; without even the implied warranty of

# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

# GNU General Public License for more details.

#

# You should have received a copy of the GNU General Public License

# along with this program; if not, write to the Free Software

# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

#

#Test the network library server is up and echo "UP" or "DOWN"

#IF NIPS is not supplied presume that the network library server is

#on the same network as the local workstation and is the 1 IP address.

#Change the setting to suit your network

#First check to local network is up

#

MYIP=`/sbin/ifconfig eth0`

GOTONE=`echo $MYIP | grep "not found"`

if [ ${#GOTONE} -lt 1 ]

then

   #Its up

   if [ $# -lt 1 ]

   then

      #Collect net IP info from the primary interface

      MYNET=`/sbin/ifconfig eth0 | grep "inet addr" | cut -d":" -f2 |\

      cut -d " " -f1 | cut -d"." -f1-3`

      NIPS="$MYNET.1"

   else

      NIPS="$1"

   fi

   echo $NIPS > $HOME/SCOOL/info/server.txt

   NIPSUP=`ping -c 1 $NIPS | grep "0 received"`

   if [ ${#NIPSUP} -gt 1 ]

   then

      echo "DOWN"

   else

      echo "UP"

   fi

else

   echo "DOWN"

fi


#!/bin/bash

#netshows.sh

#

#Return names of files in network library server without zip extension

#

# Copyright Stomfi (C) 2005

# This program is free software;

# you can redistribute it and/or modify it under the terms of the

# GNU General Public License as published by the Free Software Foundation;

# either version 2 of the License, or any later version.

#

# This program is distributed in the hope that it will be useful,

# but WITHOUT ANY WARRANTY; without even the implied warranty of

# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

# GNU General Public License for more details.

#

# You should have received a copy of the GNU General Public License

# along with this program; if not, write to the Free Software

# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

#

#The files will be on the server IP saved by the netstat.sh script

#in $HOME/SCOOL/info/server.txt

#ssh need each user to generate a key. See the ssh man page

SNSERVER=`cat $HOME/SCOOL/info/server.txt`

#We shall use ssh to get the list

#The user supplies their own password unless things have been setup

#to recognise them

NSFILES=`ssh $SNSERVER "ls /usr/public/SCOOL/library/*.zip"`

for F in $NSFILES

do

   SFNAME=`basename $F | cut -d"." -f1`

   echo "$SFNAME"

done


#!/bin/bash

#getrat.sh

#

#Updates ratings in local file to network

#Then copies network server file to local ratings file

#

# Copyright Stomfi (C) 2005

# This program is free software;

# you can redistribute it and/or modify it under the terms of the

# GNU General Public License as published by the Free Software Foundation;

# either version 2 of the License, or any later version.

#

# This program is distributed in the hope that it will be useful,

# but WITHOUT ANY WARRANTY; without even the implied warranty of

# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

# GNU General Public License for more details.

#

# You should have received a copy of the GNU General Public License

# along with this program; if not, write to the Free Software

# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

#

#The files will be on the server IP saved by the netstat.sh script

#in $HOME/SCOOL/info/server.txt

#

SNSERVER=`cat $HOME/SCOOL/info/server.txt`

#We shall use ssh to get the file

#We should set a lock so no-one else can edit the file

#This is something the server administrator should figure out

#but as a nuts and bolts suggestion the client can create a read only file

#edit.lock that no-one else can remove. Do the rest of these actions,

#and then remove it.


ssh $SNSERVER "cp /usr/public/SCOOL/ratings/ratings.txt $HOME/SCOOL/tmp"

#Update the sorted and uniqued local file into the sorted uniqed imported file

sort $HOME/SCOOL/info/ratings.txt > $HOME/SCOOL/tmp/tlratings.txt

uniq $HOME/SCOOL/tmp/tlratings.txt > $HOME/SCOOL/tmp/lratings.txt

sort $HOME/SCOOL/tmp/ratings.txt > $HOME/SCOOL/tmp/tnratings.txt

uniq $HOME/SCOOL/tmp/tnratings.txt > $HOME/SCOOL/tmp/nratings.txt

cat $HOME/SCOOL/tmp/lratings.txt >> $HOME/SCOOL/tmp/nratings.txt

uniq $HOME/SCOOL/tmp/nratings.txt > $HOME/SCOOL/tmp/ratings.txt

#put them back into place

cp $HOME/SCOOL/tmp/ratings.txt $HOME/SCOOL/info/ratings.txt

ssh $SNSERVER "cp $HOME/SCOOL/info/ratings.txt /usr/public/SCOOL/ratings/ratings.txt"




#!/bin/bash

#getnshow.sh showname

#

#Copies file in network library server to local library

#

# Copyright Stomfi (C) 2005

# This program is free software;

# you can redistribute it and/or modify it under the terms of the

# GNU General Public License as published by the Free Software Foundation;

# either version 2 of the License, or any later version.

#

# This program is distributed in the hope that it will be useful,

# but WITHOUT ANY WARRANTY; without even the implied warranty of

# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

# GNU General Public License for more details.

#

# You should have received a copy of the GNU General Public License

# along with this program; if not, write to the Free Software

# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

#

#The files will be on the server IP saved by the netstat.sh script

#in $HOME/SCOOL/info/server.txt

#

SNSERVER=`cat $HOME/SCOOL/info/server.txt`

#We shall use ssh to get the file

ssh $SNSERVER "cp /usr/public/SCOOL/library/$1.zip $HOME/SCOOL/library"


#!/bin/bash

#putnshow.sh showname

#

#Copies file in local library to network library server

#

# Copyright Stomfi (C) 2005

# This program is free software;

# you can redistribute it and/or modify it under the terms of the

# GNU General Public License as published by the Free Software Foundation;

# either version 2 of the License, or any later version.

#

# This program is distributed in the hope that it will be useful,

# but WITHOUT ANY WARRANTY; without even the implied warranty of

# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

# GNU General Public License for more details.

#

# You should have received a copy of the GNU General Public License

# along with this program; if not, write to the Free Software

# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

#

#The files will be put on the server IP saved by the netstat.sh script

#in $HOME/SCOOL/info/server.txt

#

SNSERVER=`cat $HOME/SCOOL/info/server.txt`

#We shall use ssh to put the file

ssh $SNSERVER "cp $HOME/SCOOL/library/$1.zip /usr/public/SCOOL/library"

This is all we shall do in this part. Next time we shall do all the show add/edit scripts.

Copyright Notice

Copyright Stomfi © 2005

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell