tsupport for mac os - coffin - secure lan file storage on a device
 (HTM) git clone git://parazyd.org/coffin.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) Submodules
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit b312aa14e9b6ea773158f8983db875efd417a12a
 (DIR) parent 40f3a95381fc80e7cd6d2d9b93ab67a1892c4680
 (HTM) Author: parazyd <parazyd@dyne.org>
       Date:   Tue, 12 Apr 2016 18:24:53 +0200
       
       support for mac os
       
       Diffstat:
         M helpers/makehook                    |      35 +++++++++++++++++++++++--------
       
       1 file changed, 26 insertions(+), 9 deletions(-)
       ---
 (DIR) diff --git a/helpers/makehook b/helpers/makehook
       t@@ -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() {
       t@@ -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..."
       t@@ -73,9 +88,11 @@ happenz() {
        
                                genhook create
                                [[ $? = 0 ]] && {
       -                                successmsg        
       +                                successmsg
                                }
                                ;;
       +        # }}}
       +        # {{{ delete
                        2)
                                echo -e "\n"
                                echo "Deleting an exising tomb..."
       t@@ -101,6 +118,7 @@ happenz() {
                                }
        
                                ;;
       +        # }}}
                        3)
                                echo -e "\n"
                                echo "backin up"
       t@@ -112,7 +130,6 @@ happenz() {
                        *)
                                echo -e "\n"
                                echo "No valid option. Exiting..."
       -                        return 1
                                exit
                                ;;
                esac
       t@@ -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