From 25e5e3b8378aab8090e650721a0c53ef3d4a9798 Mon Sep 17 00:00:00 2001 From: Xenofon Foukas Date: Tue, 23 Feb 2016 11:08:14 +0000 Subject: [PATCH] Added script to automatically create cache for agent --- cmake_targets/tools/make_agent_cache | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 cmake_targets/tools/make_agent_cache diff --git a/cmake_targets/tools/make_agent_cache b/cmake_targets/tools/make_agent_cache new file mode 100755 index 0000000000..d2eab20fc0 --- /dev/null +++ b/cmake_targets/tools/make_agent_cache @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +CACHE_DIR=/mnt/oai_agent_cache + +if [ ! -d $CACHE_DIR ]; then + echo "Creating cache dir in $CACHE_DIR" + sudo mkdir $CACHE_DIR +fi + +if grep -qs "$CACHE_DIR" /proc/mounts; then + echo "Agent cache is already mounted" +else + echo "Agent cache was not mounted" + echo "Mounting..." + sudo mount -o size=100m -t tmpfs none "$CACHE_DIR" + if [ $? -eq 0 ]; then + echo "Mount success" + else + echo "Something went wrong with the mount" + fi +fi