summaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorTyler Murphy <tylermurphy534@gmail.com>2022-11-08 19:35:01 -0500
committerTyler Murphy <tylermurphy534@gmail.com>2022-11-08 19:35:01 -0500
commitc98b78f4c17a0d997de2cf7aef1f8a22e1a92616 (patch)
tree4b4146cc21cd47e09f5d54d57bb09567b3dac99d /build.sh
downloadcrab-c98b78f4c17a0d997de2cf7aef1f8a22e1a92616.tar.gz
crab-c98b78f4c17a0d997de2cf7aef1f8a22e1a92616.tar.bz2
crab-c98b78f4c17a0d997de2cf7aef1f8a22e1a92616.zip
initial commit
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/build.sh b/build.sh
new file mode 100755
index 0000000..b9e3c57
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+if [[ $(/usr/bin/id -u) -ne 0 ]]; then
+ echo "Please run this as root"
+ exit
+fi
+
+# Make sure rust is able to build as root
+rustup default stable
+
+# Build crab
+cargo build --release
+
+# Copy executable to bin
+cp ./target/release/crab /bin/crab
+chown root:root /bin/crab
+chmod 6755 /bin/crab
+
+# Set up config files
+cp pam /etc/pam.d/crab
+cp -n conf /etc/crab.conf \ No newline at end of file