From 4793cf4fab4bb57a0cf0ec8c9718e19a728cf893 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 4 Oct 2011 17:07:53 -0300 Subject: Initial bootless code --- share/hydra/bootless | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100755 share/hydra/bootless diff --git a/share/hydra/bootless b/share/hydra/bootless new file mode 100755 index 0000000..751ae5c --- /dev/null +++ b/share/hydra/bootless @@ -0,0 +1,137 @@ +#!/bin/sh +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public +# License along with this program. If not, see +# . + +# Load. +source $APP_BASE/lib/hydra/functions || exit 1 +hydra_config_load + +# parameter verification +if [ $# -gt 1 ]; then + echo "Usage: $0" + exit 1 +fi + +if [ -z "$HYDRA_FOLDER" ]; then + echo "Parameter HYDRA_FOLDER not configured." + exit 1 +fi + +# script description +cat < /dev/null +if [ $? -ne 0 ]; then + echo "Error: '${gitdir}' is not a git repository." + exit 1 +fi + +# asks for target device +if [ $# -lt 1 ]; then + echo -n "Target device: " + read device +else + device=$2 +fi + +# target device consistency check +if [ ! -b ${device} ]; then + echo "Error: device \"${device}\" not found." + exit 1 +fi + +if [ "`mount | grep ${device}`" != "" ]; then + echo "Error: device \"${device}\" is mounted." +fi + +# verifies that user is sure about that +cat <