Initial commit.
This commit is contained in:
68
configure-server.sh
Normal file
68
configure-server.sh
Normal file
@@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env bash
|
||||
# Configure Server
|
||||
|
||||
if [[ "$(whoami)" == "root" ]]; then
|
||||
echo "Please run configure-server as your user, not as root."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
logFile="/tmp/configure-server.log"
|
||||
filter_ansi() {
|
||||
sed -r -e 's/\x1B\[[0-9;]*[A-Za-z]//g' \
|
||||
-e 's/\x1B[()#][0-9A-Za-z]//g' \
|
||||
-e 's/\x1B[><=]//g' \
|
||||
-e 's/\x0F//g' \
|
||||
-e 's/\x1B\[?[0-9;]*[A-Za-z]//g' \
|
||||
-e 's/\x1B\][0-9]*;[^\x07]*\x07//g' \
|
||||
-e 's/\x1B\][0-9]*;[^\x1B]*\x1B\\//g' \
|
||||
-e 's/\x08//g' \
|
||||
-e 's/\r//g' \
|
||||
-e 's/\x1B\[\?1049[hl]//g' \
|
||||
-e 's/\x1B\[\?1[hl]//g' \
|
||||
-e 's/\x1B\[\?1000[hl]//g' \
|
||||
-e '/^[[:space:]]*$/d' \
|
||||
-e ':a;N;$!ba;s/\n{2,}/\n/g'
|
||||
}
|
||||
|
||||
exec > >(stdbuf -oL tee >(filter_ansi >> "$logFile")) 2> >(stdbuf -oL tee >(filter_ansi >> "$logFile") >&2)
|
||||
|
||||
unset sudoFlags
|
||||
if [[ -x /etc/audibleprompt.sh ]]; then
|
||||
export SUDO_ASKPASS=/etc/audibleprompt.sh
|
||||
export sudoFlags=("-A")
|
||||
fi
|
||||
|
||||
source .includes/functions.sh
|
||||
source .includes/ui.sh
|
||||
|
||||
while true; do
|
||||
choice="$(menulist "Firewall" "MiniDLNA" "Mumble Server" "Nginx" "Top Speed Server" "Top Speed Console" "Copyparty" "Exit")" || break
|
||||
case "$choice" in
|
||||
"Firewall")
|
||||
source .includes/firewall.sh
|
||||
;;
|
||||
"MiniDLNA")
|
||||
source .includes/minidlna.sh
|
||||
;;
|
||||
"Mumble Server")
|
||||
source .includes/mumble.sh
|
||||
;;
|
||||
"Nginx")
|
||||
source .includes/nginx.sh
|
||||
;;
|
||||
"Top Speed Server")
|
||||
source .includes/topspeed.sh install
|
||||
;;
|
||||
"Top Speed Console")
|
||||
source .includes/topspeed.sh console
|
||||
;;
|
||||
"Copyparty")
|
||||
source .includes/copyparty.sh
|
||||
;;
|
||||
"Exit")
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user