summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2020-03-20 00:47:48 +0530
committerAndinus <andinus@nand.sh>2020-03-20 00:47:48 +0530
commit929e30adced38ac82f4482aa8c0c813e6fa2471b (patch)
treef3a50120dec172f1dfb59eb69632a4e614bbea55
parent4f406504910abdd2f604d3cc29fc41a4f63964ea (diff)
downloadcetus-929e30adced38ac82f4482aa8c0c813e6fa2471b.tar.gz
Add install instruction to readme
-rw-r--r--README.org12
-rwxr-xr-xscripts/install.sh65
2 files changed, 77 insertions, 0 deletions
diff --git a/README.org b/README.org
index e5481ad..de3482a 100644
--- a/README.org
+++ b/README.org
@@ -43,3 +43,15 @@ demo videos someday.
 | v0.4.1  | https://diode.zone/videos/watch/a52cc728-93e5-4bba-9375-752e1dba306d |
 | v0.3.1  | https://diode.zone/videos/watch/0808c512-315a-4dab-9526-4a537e8c3257 |
 | v0.2.0  | https://diode.zone/videos/watch/12db31e1-3517-4888-ad06-55f3859447a1 |
+* Installation
+** Pre-built binaries
+Pre-built binaries are available for OpenBSD, FreeBSD & Linux.
+
+If you don't understand what this command does then don't run it. It doesn't
+download the binary, it will just print the steps to install cetus & you have to
+run those commands manually. Better yet don't pipe it directly to sh but review
+it before running.
+
+#+BEGIN_SRC sh
+curl -s https://framagit.org/andinus/cetus/-/raw/master/scripts/install.sh | sh
+#+END_SRC
diff --git a/scripts/install.sh b/scripts/install.sh
new file mode 100755
index 0000000..5fc910e
--- /dev/null
+++ b/scripts/install.sh
@@ -0,0 +1,65 @@
+#!/bin/sh
+
+freebsdH="dae9b5b61e96919e94f7cd9510fd06ce318290fdee9dcd459005baaf67471377"
+openbsdH="49a8a899302267a103a7406032debef40d7cfd25cf856cf3a34cac969fba3490"
+linuxH="711265cc460989a42906b0ff46946dd55810682587469623ce86776223f02347"
+
+earlyCheck(){
+    os=`uname`
+    os=`echo $os | tr "[:upper:]" "[:lower:"]`
+
+    case $os in
+        *openbsd* | *linux* | *freebsd* ) ;;
+        *)
+            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.5.1/cetus-v0.5.1-$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 "You may want to verify the hash of the downloaded file."
+    echo "This is sha256 hash for cetus built for: $os $cpu"
+    case $os in
+        *openbsd* )
+            echo "$openbsdH"
+            ;;
+        *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.5.1"
+echo
+earlyCheck
+getURL
+printURL