#!/bin/sh
# A quick, dirty script for starting a process
# Works at least for bash 4.2.25(1)-release (x86_64-pc-linux-gnu)
# Don't forget to assign a proper previledge to this file
# Usage: proc_start.sh
# proc_stop.sh @ https://gist.github.com/photonxp/326739675882076166c047b2b96e9faa
proc_name=proc.name
daemon=/absolute/path/to/$proc_name
pidpath=/tmp/redsocks.pid
user="uname:ugroup"
#For some reason, $cmd doesn't work for this command, which leads to writing extra bizarre file to the directory.
touch $pidpath || exit
echo "touch $pidpath || exit"
chown $user $pidpath
echo "chown $user $pidpath"
confpath=/absolute/path/to/proc_name.conf
echo "Starting $proc_name ..."
$daemon -c $confpath -p $pidpath
echo "$daemon -c $confpath -p $pidpath"
echo "Start script done ..."