Started work on nginxd

This commit is contained in:
Stephen Cochrane 2020-10-14 23:28:25 +02:00
parent 85763eb875
commit 66c130ff26
1 changed files with 34 additions and 0 deletions

34
nginxd Executable file
View File

@ -0,0 +1,34 @@
#!/bin/bash
# @Auther skiqqy
# This script allows me to enable/disable certain sections of my website.
help_menu () {
echo "Welcome!"
echo -e "e\t->\tEnable a unit."
echo -e "d\t->\tDisable a unit."
echo -e "h\t->\tShows this message."
}
error () {
echo "[ERROR] $1"
exit $2
}
while getopts "he:d:" opt
do
case $opt in
h)
help_menu
;;
e | d)
[ ! -z $unit ] && error "Unit <$unit> already set" 1
[[ $opt == "e" ]] && oper=e || oper=d
unit="$OPTARG"
;;
*)
exit 2
;;
esac
done
echo $unit, $oper