[Server-devel] 20-xc-generic

Jerry Vonau jvonau at shaw.ca
Tue Aug 6 02:31:46 EDT 2013


On Tue, 2013-08-06 at 08:03 +0200, Tony Anderson wrote:
> On 08/06/2013 05:40 AM, Jerry Vonau wrote:
> > Think the attachment got scrubbed in digest mode. Can you reply to this
> > tread with the contents of 20-xc-generic script please?
> #!/bin/bash
> # Author: Daniel Drake <dsd at laptop.org>
> # XS auto-usbmount import script for code parts of the e-library
> #modified for Rwanda configuration <tony_anderson at usa.net>
> # execute XC-install if found
> set -e
> 
> VERBOSE=no
> 
> # Log a string via the syslog facility.
> log()
> {
>      if test $1 != debug || expr "$VERBOSE" : "[yY]" > /dev/null; then
>          logger -p user.$1 -t "rwxc-code[$$]" -- "$2"
>          echo "$(date "+%F %T") rwxc-code: $2"
>      fi
> }
> 
> error_beep()
> {
>      echo -en '\033[10;1000]\033[11;100]\007' > /dev/console
>      sleep 0.2
>      echo -en '\033[10;1000]\033[11;100]\007' > /dev/console
>      sleep 0.2
>      echo -en '\033[10]\033[11]' > /dev/console
>      return 0
> }
> 
> if [ -f "$UM_MOUNTPOINT"/XC/xc-install ]; then
>          exec >> $UM_MOUNTPOINT/xc-usbmount.txt 2>&1
> fi
> 
> if [ -f "$UM_MOUNTPOINT"/xc.*.tar.bz2 ]; then
>          exec >> $UM_MOUNTPOINT/xc-usbmount.txt 2>&1
> fi
> 
> if [ -f "$UM_MOUNTPOINT"/xc.*.tar.bz2 ]; then
>          log notice "Updating School Server"
>          rm -rf /library/update
>          mkdir /library/update
>          cp "$UM_MOUNTPOINT"/xc.*tar.bz2 /library/update
>          cd /library/update
>          tar -xvf xc.*.tar.bz2
>          if bash xc-update; then
>              log notice "School server updated successfully"
>          else
>              log notice "School server update failed with code $?"
>              error_beep
>          fi
> fi
> 
> if [ -f "$UM_MOUNTPOINT"/XC/xc-install ]; then
>      log notice "Installing XC"
>      cd $UM_MOUNTPOINT/XC
>      if bash xc-install; then
>          log notice "XC installed successfully"
>      else
>          log notice "XC install failed with code $?"
>          error_beep
>      fi
> fi

Thank you.

Jerry



More information about the Server-devel mailing list