coffin

secure lan file storage on a device
git clone git://parazyd.org/coffin.git
Log | Files | Refs | Submodules | README | LICENSE

commit b312aa14e9b6ea773158f8983db875efd417a12a
parent 40f3a95381fc80e7cd6d2d9b93ab67a1892c4680
Author: parazyd <parazyd@dyne.org>
Date:   Tue, 12 Apr 2016 18:24:53 +0200

support for mac os

Diffstat:
Mhelpers/makehook | 35++++++++++++++++++++++++++---------
1 file changed, 26 insertions(+), 9 deletions(-)

diff --git a/helpers/makehook b/helpers/makehook @@ -7,11 +7,20 @@ hooks="hook" davfile="davpasswd" +system=`uname -o` + gendav() { - daventry=`echo -n "${undertaker}:WebDAV:" \ - && echo -n "${undertaker}:WebDAV:${davpass}" \ - | md5sum \ - | awk '{print $1}'` + if [[ $system == "GNU/Linux" ]]; then + daventry=`echo -n "${undertaker}:WebDAV:" \ + && echo -n "${undertaker}:WebDAV:${davpass}" \ + | md5sum \ + | awk '{print $1}'` + elif [[ $system == "Darwin" ]]; then + daventry=`echo -n "${undertaker}:WebDAV:" \ + && echo -n "${undertaker}:WebDAV:${davpass}" \ + | md5 \ + | awk '{print $NF}'` + fi } successmsg() { @@ -32,19 +41,25 @@ genhook() { echo $daventry >> $davfile ;; delete) - echo "delete" + hookentry="delete:${undertaker}:${tombname}" + [[ -f ${tombname}.key ]] || { + echo "WARNING: This delete hook will not work, as you do not +have the keyfile used for it with you." + } + echo $hookentry >> $hooks ;; backup) echo "backup" ;; *) - echo "fuck off" + echo "how did you even get here?" ;; esac } happenz() { case $1 in + # {{{ create 1) echo -e "\n" echo "Creating a new tomb..." @@ -73,9 +88,11 @@ happenz() { genhook create [[ $? = 0 ]] && { - successmsg + successmsg } ;; + # }}} + # {{{ delete 2) echo -e "\n" echo "Deleting an exising tomb..." @@ -101,6 +118,7 @@ happenz() { } ;; + # }}} 3) echo -e "\n" echo "backin up" @@ -112,7 +130,6 @@ happenz() { *) echo -e "\n" echo "No valid option. Exiting..." - return 1 exit ;; esac @@ -125,7 +142,7 @@ main() { ..:: COFFIN ::.. = cryptographic office filer for important nuggets = version 0.4 - https://coffin.dyne.org + https://coffin.dyne.org 1) Create a new tomb on the coffin 2) Delete an existing tomb on the coffin