summaryrefslogtreecommitdiff
path: root/deployments/source
diff options
context:
space:
mode:
Diffstat (limited to 'deployments/source')
-rwxr-xr-xdeployments/source/install.sh21
-rwxr-xr-xdeployments/source/uninstall.sh11
2 files changed, 32 insertions, 0 deletions
diff --git a/deployments/source/install.sh b/deployments/source/install.sh
new file mode 100755
index 0000000..5b95a83
--- /dev/null
+++ b/deployments/source/install.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+if [[ $(/usr/bin/id -u) -ne 0 ]]; then
+ echo "Please run this as root"
+ exit
+fi
+
+# Copy executable to bin
+cp ./target/release/crab /usr/bin/crab
+chown root:root /bin/crab
+chmod 4755 /bin/crab
+
+# Set up config files
+cp pam /etc/pam.d/crab
+chmod 600 /etc/pam.d/crab
+
+mkdir /usr/share/crab
+chmod 644 /usr/share/crab
+
+cp conf /usr/share/crab/crab.conf
+chmod 644 /usr/share/crab/crab.conf
diff --git a/deployments/source/uninstall.sh b/deployments/source/uninstall.sh
new file mode 100755
index 0000000..cf7ade8
--- /dev/null
+++ b/deployments/source/uninstall.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+if [[ $(/usr/bin/id -u) -ne 0 ]]; then
+ echo "Please run this as root"
+ exit
+fi
+
+# Delete crab files
+rm /etc/pam.d/crab
+rm /usr/bin/crab
+rm -fr /usr/share/crab