#!/bin/sh . /etc/functions # Copy snap7 library to ramdisk cp /opt/fesa/nfs/arch/x86_64/lib/libsnap7.so /usr/lib FESA_BASE=/opt/fesa FESA_MOUNT="$FESA_BASE/nfs" FESA_DUFOLDER="$FESA_BASE/du" FESA_SERVER=${TFTP:-fsl00c} FESA_EXPORT=/common/export/fesa [ -d "$FESA_MOUNT" ] || mkdir -p "$FESA_MOUNT" # mount nfs to copy stuff # could be unmounted after startup if grep -q "$FESA_MOUNT" /proc/mounts; then log_debug "nfs already mounted" else [ -d "$FESA_MOUNT" ] || mkdir -p "$FESA_MOUNT" mount -t nfs -o ro,nolock,nfsvers=2 $FESA_SERVER:$FESA_EXPORT $FESA_MOUNT if [ $? -eq 0 ]; then log "mounted $FESA_SERVER:$FESA_EXPORT $FESA_MOUNT" else log_fatal "failed to mount $FESA_SERVER:$FESA_EXPORT $FESA_MOUNT" fi fi # copy all .param files to ramdisk/daemon-folder for i in $FESA_MOUNT/local/$HOSTNAME/*; do if [ ! -d $i ]; then continue # skip non-dirs and nullglob fi DU=$(basename "$i") # install all available param files for f in $FESA_MOUNT/local/$HOSTNAME/$DU/*.silecsparam; do if [ ! -e "$f" ]; then continue 2 fi log "installing file for daemon: $f" install -m 644 $f $FESA_DUFOLDER/$DU done done