mirror of https://github.com/tteck/Proxmox.git
Compare commits
No commits in common. "b0c32c4e47c214890362b15f8c8b84e5d462cc1f" and "8bc37d93b7636ea408a1ae7653f023d3eadfe0c5" have entirely different histories.
b0c32c4e47
...
8bc37d93b7
|
@ -11,9 +11,6 @@
|
||||||
|
|
||||||
- **Proxmox VE LXC Updater**
|
- **Proxmox VE LXC Updater**
|
||||||
- Now displays which containers require a reboot.
|
- Now displays which containers require a reboot.
|
||||||
- **File Browser**
|
|
||||||
- Uninstall by re-executing the script
|
|
||||||
- Option to use No Authentication
|
|
||||||
|
|
||||||
## 2023-10-05
|
## 2023-10-05
|
||||||
|
|
||||||
|
|
|
@ -6,14 +6,13 @@
|
||||||
# https://github.com/tteck/Proxmox/raw/main/LICENSE
|
# https://github.com/tteck/Proxmox/raw/main/LICENSE
|
||||||
|
|
||||||
function header_info {
|
function header_info {
|
||||||
clear
|
|
||||||
cat <<"EOF"
|
cat <<"EOF"
|
||||||
_______ __ ____
|
_______ __ ____
|
||||||
/ ____(_) /__ / __ )_________ _ __________ _____
|
/ ____(_) /__ / __ )_________ _ __________ _____
|
||||||
/ /_ / / / _ \/ __ / ___/ __ \ | /| / / ___/ _ \/ ___/
|
/ /_ / / / _ \/ __ / ___/ __ \ | /| / / ___/ _ \/ ___/
|
||||||
/ __/ / / / __/ /_/ / / / /_/ / |/ |/ (__ ) __/ /
|
/ __/ / / / __/ /_/ / / / /_/ / |/ |/ (__ ) __/ /
|
||||||
/_/ /_/_/\___/_____/_/ \____/|__/|__/____/\___/_/
|
/_/ /_/_/\___/_____/_/ \____/|__/|__/____/\___/_/
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
IP=$(hostname -I | awk '{print $1}')
|
IP=$(hostname -I | awk '{print $1}')
|
||||||
|
@ -29,21 +28,24 @@ HOLD="-"
|
||||||
CM="${GN}✓${CL}"
|
CM="${GN}✓${CL}"
|
||||||
APP="FileBrowser"
|
APP="FileBrowser"
|
||||||
hostname="$(hostname)"
|
hostname="$(hostname)"
|
||||||
|
set -o errexit
|
||||||
|
set -o errtrace
|
||||||
|
set -o nounset
|
||||||
|
set -o pipefail
|
||||||
|
shopt -s expand_aliases
|
||||||
|
alias die='EXIT=$? LINE=$LINENO error_exit'
|
||||||
|
trap die ERR
|
||||||
|
|
||||||
|
function error_exit() {
|
||||||
|
trap - ERR
|
||||||
|
local reason="Unknown failure occured."
|
||||||
|
local msg="${1:-$reason}"
|
||||||
|
local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
|
||||||
|
echo -e "$flag $msg" 1>&2
|
||||||
|
exit $EXIT
|
||||||
|
}
|
||||||
|
clear
|
||||||
header_info
|
header_info
|
||||||
if [ -f /root/filebrowser.db ]; then
|
|
||||||
read -r -p "Would you like to uninstall ${APP} on $hostname.? <y/N> " prompt
|
|
||||||
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
|
|
||||||
systemctl disable -q --now filebrowser.service
|
|
||||||
rm -rf /usr/local/bin/filebrowser /root/filebrowser.db /etc/systemd/system/filebrowser.service
|
|
||||||
echo "$APP Removed"
|
|
||||||
sleep 2
|
|
||||||
clear
|
|
||||||
exit
|
|
||||||
else
|
|
||||||
clear
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
while true; do
|
while true; do
|
||||||
read -p "This will Install ${APP} on $hostname. Proceed(y/n)?" yn
|
read -p "This will Install ${APP} on $hostname. Proceed(y/n)?" yn
|
||||||
case $yn in
|
case $yn in
|
||||||
|
@ -52,6 +54,7 @@ while true; do
|
||||||
*) echo "Please answer yes or no." ;;
|
*) echo "Please answer yes or no." ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
clear
|
||||||
header_info
|
header_info
|
||||||
function msg_info() {
|
function msg_info() {
|
||||||
local msg="$1"
|
local msg="$1"
|
||||||
|
@ -63,27 +66,17 @@ function msg_ok() {
|
||||||
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
|
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
|
||||||
}
|
}
|
||||||
|
|
||||||
read -r -p "Would you like to use No Authentication? <y/N> " prompt
|
|
||||||
msg_info "Installing ${APP}"
|
msg_info "Installing ${APP}"
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/filebrowser/filebrowser/releases/latest | grep -o '"tag_name": ".*"' | sed 's/"//g' | sed 's/tag_name: //g')
|
RELEASE=$(curl -fsSL https://api.github.com/repos/filebrowser/filebrowser/releases/latest | grep -o '"tag_name": ".*"' | sed 's/"//g' | sed 's/tag_name: //g')
|
||||||
curl -fsSL https://github.com/filebrowser/filebrowser/releases/download/$RELEASE/linux-amd64-filebrowser.tar.gz | tar -xzv -C /usr/local/bin &>/dev/null
|
curl -fsSL https://github.com/filebrowser/filebrowser/releases/download/$RELEASE/linux-amd64-filebrowser.tar.gz | tar -xzv -C /usr/local/bin &>/dev/null
|
||||||
|
filebrowser config init -a '0.0.0.0' &>/dev/null
|
||||||
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
|
filebrowser config set -a '0.0.0.0' &>/dev/null
|
||||||
filebrowser config init -a '0.0.0.0' &>/dev/null
|
filebrowser users add admin changeme --perm.admin &>/dev/null
|
||||||
filebrowser config set -a '0.0.0.0' &>/dev/null
|
|
||||||
filebrowser config init --auth.method=noauth &>/dev/null
|
|
||||||
filebrowser config set --auth.method=noauth &>/dev/null
|
|
||||||
filebrowser users add ID 1 --perm.admin &>/dev/null
|
|
||||||
else
|
|
||||||
filebrowser config init -a '0.0.0.0' &>/dev/null
|
|
||||||
filebrowser config set -a '0.0.0.0' &>/dev/null
|
|
||||||
filebrowser users add admin changeme --perm.admin &>/dev/null
|
|
||||||
fi
|
|
||||||
msg_ok "Installed ${APP} on $hostname"
|
msg_ok "Installed ${APP} on $hostname"
|
||||||
|
|
||||||
msg_info "Creating Service"
|
msg_info "Creating Service"
|
||||||
cat <<EOF >/etc/systemd/system/filebrowser.service
|
service_path="/etc/systemd/system/filebrowser.service"
|
||||||
[Unit]
|
echo "[Unit]
|
||||||
Description=Filebrowser
|
Description=Filebrowser
|
||||||
After=network-online.target
|
After=network-online.target
|
||||||
|
|
||||||
|
@ -93,9 +86,9 @@ WorkingDirectory=/root/
|
||||||
ExecStart=/usr/local/bin/filebrowser -r /
|
ExecStart=/usr/local/bin/filebrowser -r /
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=default.target
|
WantedBy=default.target" >$service_path
|
||||||
EOF
|
|
||||||
systemctl enable -q --now filebrowser.service
|
systemctl enable --now filebrowser.service &>/dev/null
|
||||||
msg_ok "Created Service"
|
msg_ok "Created Service"
|
||||||
|
|
||||||
msg_ok "Completed Successfully!\n"
|
msg_ok "Completed Successfully!\n"
|
||||||
|
|
Loading…
Reference in New Issue