make_agent_cache 475 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 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