Skip to content

Instantly share code, notes, and snippets.

sudo apt -y install monit
echo "Creating monit config to restart zend automatically"
wget https://gist.githubusercontent.com/iamniks/7371ca06aa9469c3a61fbd21f5e8e7a9/raw/699c67df4804e1ae88498225e61d16285f74c637/zen_node.sh
chmod u+x /home/$USER/zen_node.sh
sed -i "s/%USER%/$USER/g" zen_node.sh
@iamniks
iamniks / zen_node.sh
Last active December 12, 2017 13:52
Stratup config for monit
#!/bin/bash
PID_FILE='/home/%USER%/.zen/zen_node.pid'
start() {
touch $PID_FILE
eval "/bin/su %USER% -c '/usr/bin/zend 2>&1 >> /dev/null'"
PID=$(ps aux | grep zend | grep -v grep | awk '{print $2}')
echo "Starting zend with PID $PID"
echo $PID > $PID_FILE
#!/usr/bin/env bash
# IMPORTANT: Run this script from /home/<USER>/ directory: bash -c "$(curl SCRIPT_URL)"
# (optional): Preparing the environment if you want to install zen from source:
# Once you get the VM up and running you need to login with your root account and run below commands.
# apt-get update && apt-get upgrade -y
# apt-get install -y build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python zlib1g-dev wget bsdmainutils automake libgtk2.0-dev && apt-get autoremove -y