Add keep-rc-alive.sh

This commit is contained in:
Dmitri Popov
2018-03-31 16:23:12 +02:00
parent 2eab273d16
commit 5e2e00d3d3
2 changed files with 27 additions and 3 deletions

24
scripts/keep-rc-alive.sh Normal file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
#!/usr/bin/env bash
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
while :
do
if [[ ! $(pgrep -f rc.py) ]]; then
cd /home/pi/little-backup-box/rc/
sudo python3 rc.py
fi
done