mirror of
https://github.com/skiqqy/skiqqy.github.io
synced 2024-12-24 16:02:06 +00:00
Started work on nginxd
This commit is contained in:
parent
85763eb875
commit
66c130ff26
34
nginxd
Executable file
34
nginxd
Executable 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
|
Loading…
Reference in New Issue
Block a user