summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorflu0r1ne <flu0r1ne@flu0r1ne.net>2022-06-25 14:14:54 -0500
committerflu0r1ne <flu0r1ne@flu0r1ne.net>2022-06-25 14:14:54 -0500
commit9b34d154be78f253c7228767b78babd24af76f65 (patch)
tree3806c2bde2b9806e9d5e2dc91b048a3eb0c30a61
downloadbash-starter-9b34d154be78f253c7228767b78babd24af76f65.tar.xz
bash-starter-9b34d154be78f253c7228767b78babd24af76f65.zip
Add die function, safemode, and makefile
-rw-r--r--LICENSE7
-rw-r--r--Makefile20
-rw-r--r--starter.bash22
3 files changed, 49 insertions, 0 deletions
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..0fe289b
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,7 @@
+Copyright © 2022 Flu0r1ne
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..b125340
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,20 @@
+ifeq ($(PREFIX),)
+ PREFIX := /usr/local
+endif
+
+ifeq ($(BINDIR),)
+ BINDIR := /bin
+endif
+
+CMD=ENTER_CMD_HERE
+
+make:
+
+install:
+ mkdir -p $(DESTDIR)$(PREFIX)$(BINDIR)/
+ install -m 755 $(CMD) $(DESTDIR)$(PREFIX)$(BINDIR)/
+
+uninstall:
+ rm -rf $(DESTDIR)$(PREFIX)$(BINDIR)/$(CMD)
+
+.PHONY: install uninstall make
diff --git a/starter.bash b/starter.bash
new file mode 100644
index 0000000..abbd8ab
--- /dev/null
+++ b/starter.bash
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+set -eo pipefail
+IFS=$'\n\t'
+
+PROGRAM="${0##*/}"
+
+# EXTRACT ARGUMENTS
+# ARG1 = "$1"
+
+set -u
+
+die () {
+ if [[ $# -eq 0 ]]; then
+ echo -n "$PROGRAM: " 1>&2
+ cat <&0 1>&2
+ elif [[ $# -eq 1 ]]; then
+ echo "$PROGRAM: $1" 1>&2
+ fi
+
+ exit 1
+}