#!/bin/sh # # 2010 Nico Schottelius (nico-nsbin at schottelius.org) # # This file is part of nsbin. # # nsbin 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. # # nsbin 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 nsbin. If not, see . # # Submit solution according to http://edu.panter.ch/FormelleBedingungenUebungenBetriebssysteme # if [ $# -ne 2 ]; then cat << eof $0: eof exit 1 fi subject_suff="$1"; shift input="$1"; shift self="nschotte" to="bseelige" domain="@hsz-t.ch" self_q="${self}${domain}" to_q="${to}${domain}" subject_pref="[Betriebssysteme]" sendmail="/usr/sbin/sendmail" to_all="${to_q} ${self_q}" to_all="${to_q}" ( ( cat << eof To: $to_all Subject: $subject_pref $subject_suff From: $self_q eof ) tar c "${input}" | gzip -9 | uuencode "${subject_suff}.tar.gz" ) | $sendmail -f "$self_q" $to_all