#!/bin/bash

UMOUNT_ONLY=$1

if [ "$UMOUNT_ONLY" != "" ]; then
  umount /opt/pos/server/data/tmp
  umount /opt/pos/common/tmp
  exit
fi

STATION_NUMBER=`cat /opt/pos/etc/config.ini | grep STATION_NUMBER | cut -f2 -d=`
#TOTAL_RAM=`free | grep Mem | awk {'print $2;'}`

if [ "$STATION_NUMBER" = "0" ]; then
  DIR=/opt/pos/server/data/tmp
  umount $DIR 2> /dev/null
  mount -t tmpfs -o size=10M,mode=0777 tmpfs $DIR
fi

DIR=/opt/pos/common/tmp
umount $DIR 2> /dev/null
mount -t tmpfs -o size=10M,mode=0777 tmpfs $DIR

