summary refs log blame commit diff stats
path: root/scripts/install.sh
blob: 5934991105a6be7e0247937e7adebd4c93350af5 (plain) (tree)
1
2
3
4
5
6
7
8
74
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline
#!/bin/sh

freebsdH="47913c8eebb2481bf1282535231cc82793c345ad4c0f382af50e1d7760f5ad32"
openbsdH="2abdad0520faff64cd3bdf92e194eaf9bafe1866dcde0b432f2a7e288a0806df"
linuxH="cba19402714d27ce64e57edecab9acc502542c1abb828ad9c5bd7db4241b0ff0"
netbsdH="d1346f5478931f21d6a9764287230d9362f312c91836773f6a795c7dcc77791c"
dragonflyH="88ba5cd45abf7a16e6ac3aee8d6e2403e700ed170c6f2191f4474e218cc31cb6"
darwinH="aea04ff4b027ca7d32d4cf56bdabd2cb3bc0f466ecc634cad0590b9ae774feb6"

earlyCheck(){
    os=`uname`
    os=`echo $os | tr "[:upper:]" "[:lower:"]`

    case $os in
	# Not sure about uname output on DragonFly BSD.
        *openbsd* | *linux* | *freebsd* | *netbsd* | *dragonfly* | *dragonflybsd* | *darwin* ) ;;
        *)
            echo "Pre-built binary not available for your os"
            exit 1
            ;;
    esac

    cpu=`uname -m`
    cpu=`echo $cpu | tr "[:upper:]" "[:lower:"]`

    case $cpu in
        *amd*64* | *x86*64* ) ;;
        *)
            echo "Pre-built binary not available for your cpu"
            exit 1
            ;;
    esac
}

getURL(){
    url="https://archive.org/download/cetus-v0.6.4/cetus-v0.6.4-$os-$cpu"
}

printURL(){
    echo "You can get the Pre-built binary here:"
    echo "$url"
    echo
    echo "Run these commands to install it on your device."
    echo "# curl -L -o /usr/local/bin/cetus $url"
    echo "# chmod +x /usr/local/bin/cetus"
    echo
    echo "This is sha256 hash for cetus built for: $os $cpu"
    case $os in
        *openbsd* )
            echo "$openbsdH"
            ;;
	*netbsd* )
            echo "$netbsdH"
            ;;
	*dragonflybsd* | *dragonfly* )
            echo "$dragonflyH"
            ;;
	*darwin* )
            echo "$darwinH"
            ;;
        *freebsd* )
            echo "$freebsdH"
            ;;
        *linux* )
            echo "$linuxH"
            ;;
    esac
    echo
    echo "Verify the hash by running sha256 on cetus binary."
    echo "$ sha256 /usr/local/bin/cetus"
}

echo "Cetus v0.6.4"
echo
earlyCheck
getURL
printURL
span class="w"> "<status>I'm here</status>" "<c " "hash='sha-1' " "xmlns='http://jabber.org/protocol/caps' " "node='http://profanity-im.github.io' " "ver='LpT2xs3nun7jC2sq4gg3WRDQFZ4='" "/>" "</presence>" ); assert_true(prof_output_exact("Buddy1 (mobile) is online, \"I'm here\"")); assert_true(stbbr_received( "<iq id='prof_caps_4' to='buddy1@localhost/mobile' type='get'>" "<query xmlns='http://jabber.org/protocol/disco#info' node='http://profanity-im.github.io#LpT2xs3nun7jC2sq4gg3WRDQFZ4='/>" "</iq>" )); stbbr_for_id("prof_ping_5", "<iq from='buddy1@localhost/mobile' to='stabber@localhost' id='prof_ping_5' type='result'/>" ); prof_input("/ping buddy1@localhost/mobile"); assert_true(stbbr_received( "<iq id='prof_ping_5' type='get' to='buddy1@localhost/mobile'>" "<ping xmlns='urn:xmpp:ping'/>" "</iq>" )); assert_true(prof_output_exact("Ping response from buddy1@localhost/mobile")); } void ping_jid_not_supported(void **state) { stbbr_for_id("prof_caps_4", "<iq id='prof_caps_4' to='stabber@localhost/profanity' type='result' from='buddy1@localhost/mobile'>" "<query xmlns='http://jabber.org/protocol/disco#info' node='http://profanity-im.github.io#LpT2xs3nun7jC2sq4gg3WRDQFZ4='>" "<identity category='client' type='console' name='Profanity0.6.0'/>" "<feature var='http://jabber.org/protocol/disco#info'/>" "<feature var='http://jabber.org/protocol/caps'/>" "</query>" "</iq>" ); prof_connect(); stbbr_send( "<presence to='stabber@localhost' from='buddy1@localhost/mobile'>" "<priority>10</priority>" "<status>I'm here</status>" "<c " "hash='sha-1' " "xmlns='http://jabber.org/protocol/caps' " "node='http://profanity-im.github.io' " "ver='LpT2xs3nun7jC2sq4gg3WRDQFZ4='" "/>" "</presence>" ); assert_true(prof_output_exact("Buddy1 (mobile) is online, \"I'm here\"")); assert_true(stbbr_received( "<iq id='prof_caps_4' to='buddy1@localhost/mobile' type='get'>" "<query xmlns='http://jabber.org/protocol/disco#info' node='http://profanity-im.github.io#LpT2xs3nun7jC2sq4gg3WRDQFZ4='/>" "</iq>" )); prof_input("/ping buddy1@localhost/mobile"); assert_true(prof_output_exact("buddy1@localhost/mobile does not support ping requests.")); }