Enviado em 18/11/2018 - 16:39h
Preciso checar se o processo emerge está rodando e caso verdadeiro então deve montar um diretório na RAM (a montagem está descrita no fstab), tenho isso:
#!/bin/bash
if [ -z $(pgrep emerge) ]
then
while true
do
sleep 1
mount tmpfs
done
else
umount tmpfs
fi
pgrep emerge
# Nenhuma saída, processo não está rodando
findmnt /var/tmp/portage
TARGET SOURCE FSTYPE OPTIONS
/var/tmp/portage tmpfs tmpfs rw,noatime,size=2097152k,mode=775,uid=250,gid=250
/var/tmp/portage tmpfs tmpfs rw,noatime,size=2097152k,mode=775,uid=250,gid=250
/var/tmp/portage tmpfs tmpfs rw,noatime,size=2097152k,mode=775,uid=250,gid=250
/var/tmp/portage tmpfs tmpfs rw,noatime,size=2097152k,mode=775,uid=250,gid=250
/var/tmp/portage tmpfs tmpfs rw,noatime,size=2097152k,mode=775,uid=250,gid=250
/var/tmp/portage tmpfs tmpfs rw,noatime,size=2097152k,mode=775,uid=250,gid=250
/var/tmp/portage tmpfs tmpfs rw,noatime,size=2097152k,mode=775,uid=250,gid=250
/var/tmp/portage tmpfs tmpfs rw,noatime,size=2097152k,mode=775,uid=250,gid=250
/var/tmp/portage tmpfs tmpfs rw,noatime,size=2097152k,mode=775,uid=250,gid=250
/var/tmp/portage tmpfs tmpfs rw,noatime,size=2097152k,mode=775,uid=250,gid=250
/var/tmp/portage tmpfs tmpfs rw,noatime,size=2097152k,mode=775,uid=250,gid=250
/var/tmp/portage tmpfs tmpfs rw,noatime,size=2097152k,mode=775,uid=250,gid=250
/var/tmp/portage tmpfs tmpfs rw,noatime,size=2097152k,mode=775,uid=250,gid=250
/var/tmp/portage tmpfs tmpfs rw,noatime,size=2097152k,mode=775,uid=250,gid=250
/var/tmp/portage tmpfs tmpfs rw,noatime,size=2097152k,mode=775,uid=250,gid=250
/var/tmp/portage tmpfs tmpfs rw,noatime,size=2097152k,mode=775,uid=250,gid=250
/var/tmp/portage tmpfs tmpfs rw,noatime,size=2097152k,mode=775,uid=250,gid=250
/var/tmp/portage tmpfs tmpfs rw,noatime,size=2097152k,mode=775,uid=250,gid=250
/var/tmp/portage tmpfs tmpfs rw,noatime,size=2097152k,mode=775,uid=250,gid=250