From 27a7859c42394a78c16b24f0d08ca28667bb1efa Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 19 Feb 2009 12:20:44 -0500 Subject: creating a debian only branch out of what used to be a subversion repository --- src/Makefile.am | 34 ---- src/backupninja.in | 586 ----------------------------------------------------- src/ninjahelper.in | 268 ------------------------ src/ninjareport.in | 205 ------------------- 4 files changed, 1093 deletions(-) delete mode 100644 src/Makefile.am delete mode 100755 src/backupninja.in delete mode 100755 src/ninjahelper.in delete mode 100755 src/ninjareport.in (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index 3d5bdb8..0000000 --- a/src/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -# tyhle vygenerujeme ... -sbin_SCRIPTS = backupninja ninjahelper - -# a proto je taky musíme smazat ... -CLEANFILES = $(sbin_SCRIPTS) - -EXTRA_DIST = backupninja.in ninjahelper.in ninjareport.in - -edit = sed \ - -e "s,@CFGDIR\@,$(CFGDIR),g" \ - -e "s,@BASH\@,$(BASH),g" \ - -e "s,@AWK\@,$(AWK),g" \ - -e "s,@SED\@,$(SED),g" \ - -e 's,@datadir\@,$(pkgdatadir),g' \ - -e "s,@libdir\@,$(pkglibdir),g" \ - -e 's,@localstatedir\@,$(localstatedir),g' \ - -e 's,@prefix\@,$(prefix),g' - -#install-exec-hook: - -backupninja: $(srcdir)/backupninja.in - rm -f backupninja - $(edit) $(srcdir)/backupninja.in > backupninja - chmod ugo+x backupninja - -ninjahelper: $(srcdir)/ninjahelper.in - rm -f ninjahelper - $(edit) $(srcdir)/ninjahelper.in > ninjahelper - chmod ugo+x ninjahelper - -ninjareport: $(srcdir)/ninjareport.in - rm -f ninjareport - $(edit) $(srcdir)/ninjareport.in > ninjareport - chmod ugo+x ninjareport diff --git a/src/backupninja.in b/src/backupninja.in deleted file mode 100755 index 2a1b76e..0000000 --- a/src/backupninja.in +++ /dev/null @@ -1,586 +0,0 @@ -#!@BASH@ -# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- -# -# |\_ -# B A C K U P N I N J A /()/ -# `\| -# -# Copyright (C) 2004-05 riseup.net -- property is theft. -# -# 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 2 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. -# - -##################################################### -## FUNCTIONS - -function setupcolors () { - BLUE="\033[34;01m" - GREEN="\033[32;01m" - YELLOW="\033[33;01m" - PURPLE="\033[35;01m" - RED="\033[31;01m" - OFF="\033[0m" - CYAN="\033[36;01m" - COLORS=($BLUE $GREEN $YELLOW $RED $PURPLE $CYAN) -} - -function colorize () { - if [ "$usecolors" == "yes" ]; then - local typestr=`echo "$@" | @SED@ 's/\(^[^:]*\).*$/\1/'` - [ "$typestr" == "Debug" ] && type=0 - [ "$typestr" == "Info" ] && type=1 - [ "$typestr" == "Warning" ] && type=2 - [ "$typestr" == "Error" ] && type=3 - [ "$typestr" == "Fatal" ] && type=4 - [ "$typestr" == "Halt" ] && type=5 - color=${COLORS[$type]} - endcolor=$OFF - echo -e "$color$@$endcolor" - else - echo -e "$@" - fi -} - -# We have the following message levels: -# 0 - debug - blue -# 1 - normal messages - green -# 2 - warnings - yellow -# 3 - errors - red -# 4 - fatal - purple -# 5 - halt - cyan -# First variable passed is the error level, all others are printed - -# if 1, echo out all warnings, errors, or fatal -# used to capture output from handlers -echo_debug_msg=0 - -usecolors=yes - -function printmsg() { - [ ${#@} -gt 1 ] || return - - type=$1 - shift - if [ $type == 100 ]; then - typestr=`echo "$@" | @SED@ 's/\(^[^:]*\).*$/\1/'` - [ "$typestr" == "Debug" ] && type=0 - [ "$typestr" == "Info" ] && type=1 - [ "$typestr" == "Warning" ] && type=2 - [ "$typestr" == "Error" ] && type=3 - [ "$typestr" == "Fatal" ] && type=4 - [ "$typestr" == "Halt" ] && type=5 - typestr="" - else - types=(Debug Info Warning Error Fatal Halt) - typestr="${types[$type]}: " - fi - - print=$[4-type] - - if [ $echo_debug_msg == 1 ]; then - echo -e "$typestr$@" >&2 - elif [ $debug ]; then - colorize "$typestr$@" >&2 - fi - - if [ $print -lt $loglevel ]; then - logmsg "$typestr$@" - fi -} - -function logmsg() { - if [ -w "$logfile" ]; then - echo -e `LC_ALL=C date "+%h %d %H:%M:%S"` "$@" >> $logfile - fi -} - -function passthru() { - printmsg 100 "$@" -} -function debug() { - printmsg 0 "$@" -} -function info() { - printmsg 1 "$@" -} -function warning() { - printmsg 2 "$@" -} -function error() { - printmsg 3 "$@" -} -function fatal() { - printmsg 4 "$@" - exit 2 -} -function halt() { - printmsg 5 "$@" - exit 2 -} - -msgcount=0 -function msg { - messages[$msgcount]=$1 - let "msgcount += 1" -} - -# -# enforces very strict permissions on configuration file $file. -# - -function check_perms() { - local file=$1 - debug "check_perms $file" - local perms - local owners - - perms=($(stat -L --format='%A' $file)) - debug "perms: $perms" - local gperm=${perms:4:3} - debug "gperm: $gperm" - local wperm=${perms:7:3} - debug "wperm: $wperm" - - owners=($(stat -L --format='%g %G %u %U' $file)) - local gid=${owners[0]} - local group=${owners[1]} - local owner=${owners[2]} - - if [ "$owner" != 0 ]; then - echo "Configuration files must be owned by root! Dying on file $file" - fatal "Configuration files must be owned by root! Dying on file $file" - fi - - if [ "$wperm" != '---' ]; then - echo "Configuration files must not be world writable/readable! Dying on file $file" - fatal "Configuration files must not be world writable/readable! Dying on file $file" - fi - - if [ "$gperm" != '---' ]; then - case "$admingroup" in - $gid|$group) :;; - - *) - if [ "$gid" != 0 ]; then - echo "Configuration files must not be writable/readable by group $group! Use the admingroup option in backupninja.conf. Dying on file $file" - fatal "Configuration files must not be writable/readable by group $group! Use the admingroup option in backupninja.conf. Dying on file $file" - fi - ;; - esac - fi -} - -# simple lowercase function -function tolower() { - echo "$1" | tr '[:upper:]' '[:lower:]' -} - -# simple to integer function -function toint() { - echo "$1" | tr -d '[:alpha:]' -} - -# -# function isnow(): returns 1 if the time/day passed as $1 matches -# the current time/day. -# -# format is at