Node-gdrive-fuse automatic mount help

I switched from rclone with encryption to rclone encryption and node-gdrive-fuse. I reference two scripts in other topics to attempt to restart node-gdrive-fuse automatically when it fails, but I can’t get cron to start them. When I execute either script manually, they work fine. Any help is appreciated to let me know what i’m doing wrong.

##CRON SCRIPT##

#!/bin/sh
if ps -ef | grep -v grep | grep “node fs.es6.js” ; then
exit 0
else
/home/plex/scripts/gdrive.mount-e.mount
exit 0
fi

@jmacul2 or @Stokkes I know you guys got this working?

I changed the script a bit and setup an alias, but it still won’t execute the part ‘gfuse &’

alias gfuse=‘cd /home/plex/node-gdrive-fuse/src && node fs.es6.js --memory_reduc
er --optimize_for_size --zero_fill_buffers --max_old_space_size=4096 --expose-gc
–logfile=/home/plex/log/gdrive-fuse.log’
#Unmount any directories already mounted
/bin/fusermount -uz /home/plex/gd-encrypted
echo “Killed GD-ENCRYPTED” | tee -a “/home/plex/log/test.log”
#Kill process if any
ps -ef | grep -v grep | grep “node fs.es6.js” | awk ‘{print $2}’ | xargs kill
echo “Killed FS.ES6.JS Process” | tee -a “/home/plex/log/test.log”

#Mount the node google drive again
rm -rf /home/plex/.cache/node-gdrive-fuse
echo “DEL CACHE” | tee -a “/home/plex/log/test.log”
gfuse &
echo “RESTARTED GFUSE” | tee -a “/home/plex/log/test.log”
exit

Here’s the logs from the log file. Based on this it’s getting to the line that runs ‘gfuse &’ but it’s not starting. If I run this script manually it starts fine.

Killed GD-ENCRYPTED
Killed FS.ES6.JS Process
DEL CACHE
RESTARTED GFUSE

I got this to work by adding the following to the script.

export NVM_DIR="$HOME/.nvm"
[ -s “$NVM_DIR/nvm.sh” ] && . “$NVM_DIR/nvm.sh” # This loads nvm