mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
scripts: Various shell script cleanups (#4008)
This commit is contained in:
parent
0d51e71578
commit
fba4fd5314
5 changed files with 129 additions and 132 deletions
|
@ -1,5 +1,23 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
pecho() { printf %s\\n "$*"; }
|
||||||
|
log() { pecho "$@"; }
|
||||||
|
error() { log "ERROR: $@" >&2; }
|
||||||
|
fatal() { error "$@"; exit 1; }
|
||||||
|
is_cmd() { command -v "$@" >/dev/null 2>&1; }
|
||||||
|
|
||||||
|
# Move to the folder where ep-lite is installed
|
||||||
|
cd "$(dirname "$0")"/..
|
||||||
|
|
||||||
|
# Is wget installed?
|
||||||
|
is_cmd wget || fatal "Please install wget"
|
||||||
|
|
||||||
|
# Is zip installed?
|
||||||
|
is_cmd zip || fatal "Please install zip"
|
||||||
|
|
||||||
|
# Is zip installed?
|
||||||
|
is_cmd unzip || fatal "Please install unzip"
|
||||||
|
=======
|
||||||
#Move to the folder where ep-lite is installed
|
#Move to the folder where ep-lite is installed
|
||||||
cd $(dirname $0)
|
cd $(dirname $0)
|
||||||
|
|
||||||
|
@ -29,9 +47,9 @@ hash unzip > /dev/null 2>&1 || {
|
||||||
START_FOLDER=$(pwd);
|
START_FOLDER=$(pwd);
|
||||||
TMP_FOLDER=$(mktemp -d)
|
TMP_FOLDER=$(mktemp -d)
|
||||||
|
|
||||||
echo "create a clean environment in $TMP_FOLDER..."
|
log "create a clean environment in $TMP_FOLDER..."
|
||||||
cp -ar . $TMP_FOLDER
|
cp -ar . "$TMP_FOLDER"
|
||||||
cd $TMP_FOLDER
|
cd "$TMP_FOLDER"
|
||||||
rm -rf node_modules
|
rm -rf node_modules
|
||||||
rm -f etherpad-lite-win.zip
|
rm -f etherpad-lite-win.zip
|
||||||
|
|
||||||
|
@ -39,33 +57,33 @@ rm -f etherpad-lite-win.zip
|
||||||
# making the windows package smaller
|
# making the windows package smaller
|
||||||
export NODE_ENV=production
|
export NODE_ENV=production
|
||||||
|
|
||||||
echo "do a normal unix install first..."
|
log "do a normal unix install first..."
|
||||||
bin/installDeps.sh || exit 1
|
bin/installDeps.sh || exit 1
|
||||||
|
|
||||||
echo "copy the windows settings template..."
|
log "copy the windows settings template..."
|
||||||
cp settings.json.template settings.json
|
cp settings.json.template settings.json
|
||||||
|
|
||||||
echo "resolve symbolic links..."
|
log "resolve symbolic links..."
|
||||||
cp -rL node_modules node_modules_resolved
|
cp -rL node_modules node_modules_resolved
|
||||||
rm -rf node_modules
|
rm -rf node_modules
|
||||||
mv node_modules_resolved node_modules
|
mv node_modules_resolved node_modules
|
||||||
|
|
||||||
echo "download windows node..."
|
log "download windows node..."
|
||||||
cd bin
|
cd bin
|
||||||
wget "https://nodejs.org/dist/latest-erbium/win-x86/node.exe" -O ../node.exe
|
wget "https://nodejs.org/dist/latest-erbium/win-x86/node.exe" -O ../node.exe
|
||||||
|
|
||||||
echo "remove git history to reduce folder size"
|
log "remove git history to reduce folder size"
|
||||||
rm -rf .git/objects
|
rm -rf .git/objects
|
||||||
|
|
||||||
echo "remove windows jsdom-nocontextify/test folder"
|
log "remove windows jsdom-nocontextify/test folder"
|
||||||
rm -rf $TMP_FOLDER/src/node_modules/wd/node_modules/request/node_modules/form-data/node_modules/combined-stream/test
|
rm -rf "$TMP_FOLDER"/src/node_modules/wd/node_modules/request/node_modules/form-data/node_modules/combined-stream/test
|
||||||
rm -rf $TMP_FOLDER/src/node_modules/nodemailer/node_modules/mailcomposer/node_modules/mimelib/node_modules/encoding/node_modules/iconv-lite/encodings/tables
|
rm -rf "$TMP_FOLDER"/src/node_modules/nodemailer/node_modules/mailcomposer/node_modules/mimelib/node_modules/encoding/node_modules/iconv-lite/encodings/tables
|
||||||
|
|
||||||
echo "create the zip..."
|
log "create the zip..."
|
||||||
cd $TMP_FOLDER
|
cd "$TMP_FOLDER"
|
||||||
zip -9 -r $START_FOLDER/etherpad-lite-win.zip ./*
|
zip -9 -r "$START_FOLDER"/etherpad-lite-win.zip ./*
|
||||||
|
|
||||||
echo "clean up..."
|
log "clean up..."
|
||||||
rm -rf $TMP_FOLDER
|
rm -rf "$TMP_FOLDER"
|
||||||
|
|
||||||
echo "Finished. You can find the zip in the Etherpad root folder, it's called etherpad-lite-win.zip"
|
log "Finished. You can find the zip in the Etherpad root folder, it's called etherpad-lite-win.zip"
|
|
@ -1,20 +1,15 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
#Move to the folder where ep-lite is installed
|
# Move to the folder where ep-lite is installed
|
||||||
cd $(dirname $0)
|
cd "$(dirname "$0")"/..
|
||||||
|
|
||||||
#Was this script started in the bin folder? if yes move out
|
# Prepare the environment
|
||||||
if [ -d "../bin" ]; then
|
|
||||||
cd "../"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#Prepare the environment
|
|
||||||
bin/installDeps.sh || exit 1
|
bin/installDeps.sh || exit 1
|
||||||
|
|
||||||
echo "If you are new to debugging Node.js with Chrome DevTools, take a look at this page:"
|
echo "If you are new to debugging Node.js with Chrome DevTools, take a look at this page:"
|
||||||
echo "https://medium.com/@paul_irish/debugging-node-js-nightlies-with-chrome-devtools-7c4a1b95ae27"
|
echo "https://medium.com/@paul_irish/debugging-node-js-nightlies-with-chrome-devtools-7c4a1b95ae27"
|
||||||
echo "Open 'chrome://inspect' on Chrome to start debugging."
|
echo "Open 'chrome://inspect' on Chrome to start debugging."
|
||||||
|
|
||||||
#Use 0.0.0.0 to allow external connections to the debugger
|
# Use 0.0.0.0 to allow external connections to the debugger
|
||||||
#(ex: running Etherpad on a docker container). Use default port # (9229)
|
# (ex: running Etherpad on a docker container). Use default port # (9229)
|
||||||
node --inspect=0.0.0.0:9229 node_modules/ep_etherpad-lite/node/server.js "$@"
|
node --inspect=0.0.0.0:9229 node_modules/ep_etherpad-lite/node/server.js "$@"
|
||||||
|
|
|
@ -8,6 +8,12 @@ REQUIRED_NODE_MINOR=13
|
||||||
REQUIRED_NPM_MAJOR=5
|
REQUIRED_NPM_MAJOR=5
|
||||||
REQUIRED_NPM_MINOR=5
|
REQUIRED_NPM_MINOR=5
|
||||||
|
|
||||||
|
pecho() { printf %s\\n "$*"; }
|
||||||
|
log() { pecho "$@"; }
|
||||||
|
error() { log "ERROR: $@" >&2; }
|
||||||
|
fatal() { error "$@"; exit 1; }
|
||||||
|
is_cmd() { command -v "$@" >/dev/null 2>&1; }
|
||||||
|
|
||||||
require_minimal_version() {
|
require_minimal_version() {
|
||||||
PROGRAM_LABEL="$1"
|
PROGRAM_LABEL="$1"
|
||||||
VERSION_STRING="$2"
|
VERSION_STRING="$2"
|
||||||
|
@ -16,71 +22,50 @@ require_minimal_version() {
|
||||||
|
|
||||||
# Flag -s (--only-delimited on GNU cut) ensures no string is returned
|
# Flag -s (--only-delimited on GNU cut) ensures no string is returned
|
||||||
# when there is no match
|
# when there is no match
|
||||||
DETECTED_MAJOR=$(echo $VERSION_STRING | cut -s -d "." -f 1)
|
DETECTED_MAJOR=$(pecho "$VERSION_STRING" | cut -s -d "." -f 1)
|
||||||
DETECTED_MINOR=$(echo $VERSION_STRING | cut -s -d "." -f 2)
|
DETECTED_MINOR=$(pecho "$VERSION_STRING" | cut -s -d "." -f 2)
|
||||||
|
|
||||||
if [ -z "$DETECTED_MAJOR" ]; then
|
[ -n "$DETECTED_MAJOR" ] || fatal "Cannot extract $PROGRAM_LABEL major version from version string \"$VERSION_STRING\""
|
||||||
printf 'Cannot extract %s major version from version string "%s"\n' "$PROGRAM_LABEL" "$VERSION_STRING" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$DETECTED_MINOR" ]; then
|
[ -n "$DETECTED_MINOR" ] || fatal "Cannot extract $PROGRAM_LABEL minor version from version string \"$VERSION_STRING\""
|
||||||
printf 'Cannot extract %s minor version from version string "%s"\n' "$PROGRAM_LABEL" "$VERSION_STRING" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$DETECTED_MAJOR" in
|
case "$DETECTED_MAJOR" in
|
||||||
''|*[!0-9]*)
|
''|*[!0-9]*)
|
||||||
printf '%s major version from "%s" is not a number. Detected: "%s"\n' "$PROGRAM_LABEL" "$VERSION_STRING" "$DETECTED_MAJOR" >&2
|
fatal "$PROGRAM_LABEL major version from \"$VERSION_STRING\" is not a number. Detected: \"$DETECTED_MAJOR\""
|
||||||
exit 1
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case "$DETECTED_MINOR" in
|
case "$DETECTED_MINOR" in
|
||||||
''|*[!0-9]*)
|
''|*[!0-9]*)
|
||||||
printf '%s minor version from "%s" is not a number. Detected: "%s"\n' "$PROGRAM_LABEL" "$VERSION_STRING" "$DETECTED_MINOR" >&2
|
fatal "$PROGRAM_LABEL minor version from \"$VERSION_STRING\" is not a number. Detected: \"$DETECTED_MINOR\""
|
||||||
exit 1
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ "$DETECTED_MAJOR" -lt "$REQUIRED_MAJOR" ] || ([ "$DETECTED_MAJOR" -eq "$REQUIRED_MAJOR" ] && [ "$DETECTED_MINOR" -lt "$REQUIRED_MINOR" ]); then
|
[ "$DETECTED_MAJOR" -gt "$REQUIRED_MAJOR" ] || ([ "$DETECTED_MAJOR" -eq "$REQUIRED_MAJOR" ] && [ "$DETECTED_MINOR" -ge "$REQUIRED_MINOR" ]) \
|
||||||
printf 'Your %s version "%s" is too old. %s %d.%d.x or higher is required.\n' "$PROGRAM_LABEL" "$VERSION_STRING" "$PROGRAM_LABEL" "$REQUIRED_MAJOR" "$REQUIRED_MINOR" >&2
|
|| fatal "Your $PROGRAM_LABEL version \"$VERSION_STRING\" is too old. $PROGRAM_LABEL $REQUIRED_MAJOR.$REQUIRED_MINOR.x or higher is required."
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#Move to the folder where ep-lite is installed
|
# Move to the folder where ep-lite is installed
|
||||||
cd $(dirname $0)
|
cd "$(dirname "$0")"/..
|
||||||
|
|
||||||
#Was this script started in the bin folder? if yes move out
|
# Is node installed?
|
||||||
if [ -d "../bin" ]; then
|
# Not checking io.js, default installation creates a symbolic link to node
|
||||||
cd "../"
|
is_cmd node || fatal "Please install node.js ( https://nodejs.org )"
|
||||||
fi
|
|
||||||
|
|
||||||
#Is node installed?
|
# Is npm installed?
|
||||||
#Not checking io.js, default installation creates a symbolic link to node
|
is_cmd npm || fatal "Please install npm ( https://npmjs.org )"
|
||||||
hash node > /dev/null 2>&1 || {
|
|
||||||
echo "Please install node.js ( https://nodejs.org )" >&2
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
#Is npm installed?
|
# Check npm version
|
||||||
hash npm > /dev/null 2>&1 || {
|
|
||||||
echo "Please install npm ( https://npmjs.org )" >&2
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
#Check npm version
|
|
||||||
NPM_VERSION_STRING=$(npm --version)
|
NPM_VERSION_STRING=$(npm --version)
|
||||||
|
|
||||||
require_minimal_version "npm" "$NPM_VERSION_STRING" "$REQUIRED_NPM_MAJOR" "$REQUIRED_NPM_MINOR"
|
require_minimal_version "npm" "$NPM_VERSION_STRING" "$REQUIRED_NPM_MAJOR" "$REQUIRED_NPM_MINOR"
|
||||||
|
|
||||||
#Check node version
|
# Check node version
|
||||||
NODE_VERSION_STRING=$(node --version)
|
NODE_VERSION_STRING=$(node --version)
|
||||||
NODE_VERSION_STRING=${NODE_VERSION_STRING#"v"}
|
NODE_VERSION_STRING=${NODE_VERSION_STRING#"v"}
|
||||||
|
|
||||||
require_minimal_version "nodejs" "$NODE_VERSION_STRING" "$REQUIRED_NODE_MAJOR" "$REQUIRED_NODE_MINOR"
|
require_minimal_version "nodejs" "$NODE_VERSION_STRING" "$REQUIRED_NODE_MAJOR" "$REQUIRED_NODE_MINOR"
|
||||||
|
|
||||||
#Get the name of the settings file
|
# Get the name of the settings file
|
||||||
settings="settings.json"
|
settings="settings.json"
|
||||||
a='';
|
a='';
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
|
@ -88,13 +73,13 @@ for arg in "$@"; do
|
||||||
a=$arg
|
a=$arg
|
||||||
done
|
done
|
||||||
|
|
||||||
#Does a $settings exist? if not copy the template
|
# Does a $settings exist? if not copy the template
|
||||||
if [ ! -f $settings ]; then
|
if [ ! -f "$settings" ]; then
|
||||||
echo "Copy the settings template to $settings..."
|
log "Copy the settings template to $settings..."
|
||||||
cp settings.json.template $settings || exit 1
|
cp settings.json.template "$settings" || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Ensure that all dependencies are up to date... If this is the first time you have run Etherpad please be patient."
|
log "Ensure that all dependencies are up to date... If this is the first time you have run Etherpad please be patient."
|
||||||
(
|
(
|
||||||
mkdir -p node_modules
|
mkdir -p node_modules
|
||||||
cd node_modules
|
cd node_modules
|
||||||
|
@ -106,8 +91,8 @@ echo "Ensure that all dependencies are up to date... If this is the first time
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
#Remove all minified data to force node creating it new
|
# Remove all minified data to force node creating it new
|
||||||
echo "Clearing minified cache..."
|
log "Clearing minified cache..."
|
||||||
rm -f var/minified*
|
rm -f var/minified*
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
40
bin/run.sh
40
bin/run.sh
|
@ -1,39 +1,37 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
#Move to the folder where ep-lite is installed
|
pecho() { printf %s\\n "$*"; }
|
||||||
cd $(dirname $0)
|
log() { pecho "$@"; }
|
||||||
|
error() { log "ERROR: $@" >&2; }
|
||||||
|
fatal() { error "$@"; exit 1; }
|
||||||
|
|
||||||
#Was this script started in the bin folder? if yes move out
|
# Move to the folder where ep-lite is installed
|
||||||
if [ -d "../bin" ]; then
|
cd "$(dirname "$0")"/..
|
||||||
cd "../"
|
|
||||||
fi
|
|
||||||
|
|
||||||
ignoreRoot=0
|
ignoreRoot=0
|
||||||
for ARG in "$@"
|
for ARG in "$@"; do
|
||||||
do
|
|
||||||
if [ "$ARG" = "--root" ]; then
|
if [ "$ARG" = "--root" ]; then
|
||||||
ignoreRoot=1
|
ignoreRoot=1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
#Stop the script if it's started as root
|
# Stop the script if it's started as root
|
||||||
if [ "$(id -u)" -eq 0 ] && [ $ignoreRoot -eq 0 ]; then
|
if [ "$(id -u)" -eq 0 ] && [ "$ignoreRoot" -eq 0 ]; then
|
||||||
echo "You shouldn't start Etherpad as root!"
|
cat <<EOF >&2
|
||||||
echo "Please type 'Etherpad rocks my socks' or supply the '--root' argument if you still want to start it as root"
|
You shouldn't start Etherpad as root!
|
||||||
|
Please type 'Etherpad rocks my socks' (or restart with the '--root'
|
||||||
|
argument) if you still want to start it as root:
|
||||||
|
EOF
|
||||||
|
printf "> " >&2
|
||||||
read rocks
|
read rocks
|
||||||
if [ ! "$rocks" == "Etherpad rocks my socks" ]
|
[ "$rocks" = "Etherpad rocks my socks" ] || fatal "Your input was incorrect"
|
||||||
then
|
|
||||||
echo "Your input was incorrect"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#Prepare the environment
|
# Prepare the environment
|
||||||
bin/installDeps.sh "$@" || exit 1
|
bin/installDeps.sh "$@" || exit 1
|
||||||
|
|
||||||
#Move to the node folder and start
|
# Move to the node folder and start
|
||||||
echo "Started Etherpad..."
|
log "Starting Etherpad..."
|
||||||
|
|
||||||
SCRIPTPATH=$(pwd -P)
|
SCRIPTPATH=$(pwd -P)
|
||||||
exec node "$SCRIPTPATH/node_modules/ep_etherpad-lite/node/server.js" "$@"
|
exec node "$SCRIPTPATH/node_modules/ep_etherpad-lite/node/server.js" "$@"
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
#This script ensures that ep-lite is automatically restarting after an error happens
|
# This script ensures that ep-lite is automatically restarting after
|
||||||
|
# an error happens
|
||||||
|
|
||||||
#Handling Errors
|
# Handling Errors
|
||||||
# 0 silent
|
# 0 silent
|
||||||
# 1 email
|
# 1 email
|
||||||
ERROR_HANDLING=0
|
ERROR_HANDLING=0
|
||||||
# Your email address which should receive the error messages
|
# Your email address which should receive the error messages
|
||||||
EMAIL_ADDRESS="no-reply@example.com"
|
EMAIL_ADDRESS="no-reply@example.com"
|
||||||
|
@ -15,54 +16,54 @@ TIME_BETWEEN_EMAILS=600 # 10 minutes
|
||||||
|
|
||||||
# DON'T EDIT AFTER THIS LINE
|
# DON'T EDIT AFTER THIS LINE
|
||||||
|
|
||||||
|
pecho() { printf %s\\n "$*"; }
|
||||||
|
log() { pecho "$@"; }
|
||||||
|
error() { log "ERROR: $@" >&2; }
|
||||||
|
fatal() { error "$@"; exit 1; }
|
||||||
|
|
||||||
LAST_EMAIL_SEND=0
|
LAST_EMAIL_SEND=0
|
||||||
|
|
||||||
|
# Move to the folder where ep-lite is installed
|
||||||
|
cd "$(dirname "$0")"/..
|
||||||
|
|
||||||
|
# Check if a logfile parameter is set
|
||||||
LOG="$1"
|
LOG="$1"
|
||||||
|
[ -n "${LOG}" ] || fatal "Set a logfile as the first parameter"
|
||||||
#Move to the folder where ep-lite is installed
|
|
||||||
cd $(dirname $0)
|
|
||||||
|
|
||||||
#Was this script started in the bin folder? if yes move out
|
|
||||||
if [ -d "../bin" ]; then
|
|
||||||
cd "../"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#Check if a logfile parameter is set
|
|
||||||
if [ -z "${LOG}" ]; then
|
|
||||||
echo "Set a logfile as the first parameter"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
shift
|
shift
|
||||||
while [ 1 ]
|
|
||||||
do
|
|
||||||
#Try to touch the file if it doesn't exist
|
|
||||||
if [ ! -f ${LOG} ]; then
|
|
||||||
touch ${LOG} || ( echo "Logfile '${LOG}' is not writeable" && exit 1 )
|
|
||||||
fi
|
|
||||||
|
|
||||||
#Check if the file is writeable
|
while true; do
|
||||||
if [ ! -w ${LOG} ]; then
|
# Try to touch the file if it doesn't exist
|
||||||
echo "Logfile '${LOG}' is not writeable"
|
[ -f "${LOG}" ] || touch "${LOG}" || fatal "Logfile '${LOG}' is not writeable"
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
#Start the application
|
# Check if the file is writeable
|
||||||
bin/run.sh $@ >>${LOG} 2>>${LOG}
|
[ -w "${LOG}" ] || fatal "Logfile '${LOG}' is not writeable"
|
||||||
|
|
||||||
#Send email
|
# Start the application
|
||||||
if [ $ERROR_HANDLING = 1 ]; then
|
bin/run.sh "$@" >>${LOG} 2>>${LOG}
|
||||||
|
|
||||||
|
TIME_FMT=$(date +%Y-%m-%dT%H:%M:%S%z)
|
||||||
|
|
||||||
|
# Send email
|
||||||
|
if [ "$ERROR_HANDLING" = 1 ]; then
|
||||||
TIME_NOW=$(date +%s)
|
TIME_NOW=$(date +%s)
|
||||||
TIME_SINCE_LAST_SEND=$(($TIME_NOW - $LAST_EMAIL_SEND))
|
TIME_SINCE_LAST_SEND=$(($TIME_NOW - $LAST_EMAIL_SEND))
|
||||||
|
|
||||||
if [ $TIME_SINCE_LAST_SEND -gt $TIME_BETWEEN_EMAILS ]; then
|
if [ "$TIME_SINCE_LAST_SEND" -gt "$TIME_BETWEEN_EMAILS" ]; then
|
||||||
printf "Server was restarted at: $(date)\nThe last 50 lines of the log before the error happens:\n $(tail -n 50 ${LOG})" | mail -s "Pad Server was restarted" $EMAIL_ADDRESS
|
{
|
||||||
|
cat <<EOF
|
||||||
|
Server was restarted at: ${TIME_FMT}
|
||||||
|
The last 50 lines of the log before the server exited:
|
||||||
|
|
||||||
|
EOF
|
||||||
|
tail -n 50 "${LOG}"
|
||||||
|
} | mail -s "Etherpad restarted" "$EMAIL_ADDRESS"
|
||||||
|
|
||||||
LAST_EMAIL_SEND=$TIME_NOW
|
LAST_EMAIL_SEND=$TIME_NOW
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "RESTART!" >>${LOG}
|
pecho "RESTART! ${TIME_FMT}" >>${LOG}
|
||||||
|
|
||||||
#Sleep 10 seconds before restart
|
# Sleep 10 seconds before restart
|
||||||
sleep 10
|
sleep 10
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue