chore(style): add shebang, set bash strict mode, create function
[webi-installers/.git] / sudo / install.sh
index 6b370606fd7328b6849f15d80548992f87e6ade1..112d8e74db8f25fef21778ec019a6163a560fe18 100644 (file)
@@ -1,14 +1,17 @@
+#!/bin/bash
 set -e
 set -u
 
-{
+function __init_sudo() {
 
     if [ -z "$(command -v sudo)" ]; then
-        >&2 echo "Error: on Linux and BSD you should install sudo via the native package manager"
-        >&2 echo "       for example: apt install -y sudo"
+        echo >&2 "Error: on Linux and BSD you should install sudo via the native package manager"
+        echo >&2 "       for example: apt install -y sudo"
         exit 1
     else
         echo "'sudo' already installed"
     fi
 
 }
+
+__init_sudo