Compare commits

...

10 Commits

Author SHA1 Message Date
tteckster ac837891e0
Create alpine-whoogle.sh 2023-03-25 15:28:01 -04:00
tteckster 4db1c1360e
Create alpine-whoogle-install.sh 2023-03-25 15:23:24 -04:00
tteckster 676f240113
Update alpine-esphome-install.sh
tweak
2023-03-25 15:07:06 -04:00
tteckster 642048fb6d
Update alpine-esphome-install.sh
correct openrc
2023-03-25 14:57:42 -04:00
tteckster 86ec03dc35
Update alpine-esphome.sh
tweak update
2023-03-25 14:56:07 -04:00
tteckster ac62f07362
Update alpine-esphome.sh 2023-03-25 11:49:59 -04:00
tteckster d345712e7b
Update alpine-esphome-install.sh 2023-03-25 11:49:10 -04:00
tteckster 18af21a1cc
Update alpine-esphome-install.sh 2023-03-25 09:25:12 -04:00
tteckster 1e42e065b4
Update alpine-esphome-install.sh 2023-03-25 09:20:18 -04:00
tteckster 38307912f8
Update alpine-esphome-install.sh 2023-03-25 09:15:22 -04:00
4 changed files with 155 additions and 30 deletions

View File

@ -66,9 +66,10 @@ function update_script() {
header_info header_info
case $CHOICE in case $CHOICE in
1) 1)
esphome stop msg_info "Updating ESPHome"
pip3 install esphome --upgrade pip3 install esphome --upgrade &>/dev/null
esphome start rc-service -q esphome restart
msg_ok "Updated Successfully!"
exit exit
;; ;;
esac esac

85
ct/alpine-whoogle.sh Normal file
View File

@ -0,0 +1,85 @@
#!/usr/bin/env bash
source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build.func)
# Copyright (c) 2021-2023 tteck
# Author: tteck (tteckster)
# License: MIT
# https://github.com/tteck/Proxmox/raw/main/LICENSE
function header_info {
clear
cat <<"EOF"
_ ____ __
| | / / /_ ____ ____ ____ _/ /__
| | /| / / __ \/ __ \/ __ \/ __ `/ / _ \
| |/ |/ / / / / /_/ / /_/ / /_/ / / __/
|__/|__/_/ /_/\____/\____/\__, /_/\___/
Alpine /____/
EOF
}
header_info
echo -e "Loading..."
APP="Alpine-Whoogle"
var_disk="0.3"
var_cpu="1"
var_ram="256"
var_os="alpine"
var_version="3.17"
variables
color
catch_errors
function default_settings() {
CT_TYPE="1"
PW=""
CT_ID=$NEXTID
HN=$NSAPP
DISK_SIZE="$var_disk"
CORE_COUNT="$var_cpu"
RAM_SIZE="$var_ram"
BRG="vmbr0"
NET=dhcp
GATE=""
DISABLEIP6="no"
MTU=""
SD=""
NS=""
MAC=""
VLAN=""
SSH="no"
VERB="no"
echo_default
}
function update_script() {
if [[ ! -f /usr/bin/whoogle-search ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
while true; do
CHOICE=$(
whiptail --title "SUPPORT" --menu "Select option" 11 58 1 \
"1" "Check for Whoogle Updates" 3>&2 2>&1 1>&3
)
exit_status=$?
if [ $exit_status == 1 ]; then
clear
exit-script
fi
header_info
case $CHOICE in
1)
msg_info "Updating Whoogle"
pip3 install whoogle-search --upgrade &>/dev/null
rc-service -q whoogle restart
msg_ok "Updated Successfully!"
exit
;;
esac
done
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:5000${CL} \n"

View File

@ -22,42 +22,29 @@ $STD apk add mc
$STD apk add git $STD apk add git
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
msg_info "Installing Alpine-ESPHome" msg_info "Installing pip3 Package Manager"
$STD apk add py3-pip $STD apk add py3-pip
msg_ok "Installed pip3 Package Manager"
msg_info "Installing Alpine-ESPHome"
$STD pip3 install esphome $STD pip3 install esphome
$STD pip3 install tornado esptool $STD pip3 install tornado esptool
cat <<EOF >/etc/init.d/esphome
#!/sbin/openrc-run
name="esphome"
description="ESPHome Service"
command="/usr/bin/esphome /root/config/ dashboard"
pidfile="/run/$RC_SVCNAME/pid"
depend() {
need net
}
start_pre() {
checkpath --directory --mode 0755 /run/$RC_SVCNAME
}
echo "#!/sbin/openrc-run
description=\"ESPHome\"
pidfile=\"/run/esphome.pid\"
start() { start() {
ebegin "Starting $description" esphome dashboard /root/esphome/config/ > /dev/null 2>&1 &
start-stop-daemon --start --quiet --exec $command echo \$! > \$pidfile
eend $?
} }
stop() { stop() {
ebegin "Stopping $description" kill \$(cat \$pidfile)
start-stop-daemon --stop --quiet --exec $command rm \$pidfile
eend $? }" > /etc/init.d/esphome
}
EOF
chmod 755 /etc/init.d/esphome chmod 755 /etc/init.d/esphome
/etc/init.d/esphome start rc-service -q esphome start
rc-update add esphome default rc-update add -q esphome default
msg_ok "Installed Alpine-ESPHome" msg_ok "Installed Alpine-ESPHome"
motd_ssh motd_ssh

View File

@ -0,0 +1,52 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2023 tteck
# Author: tteck (tteckster)
# License: MIT
# https://github.com/tteck/Proxmox/raw/main/LICENSE
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apk add newt
$STD apk add curl
$STD apk add openssh
$STD apk add nano
$STD apk add mc
msg_ok "Installed Dependencies"
msg_info "Installing pip3 Package Manager"
$STD apk add py3-pip
msg_ok "Installed pip3 Package Manager"
msg_info "Installing Alpine-Whoogle"
$STD pip3 install brotli
$STD pip3 install whoogle-search
echo "#!/sbin/openrc-run
description=\"Whoogle-Search\"
pidfile=\"/run/whoogle.pid\"
start() {
/usr/bin/whoogle-search --host 0.0.0.0 &
echo \$! > \$pidfile
}
stop() {
kill \$(cat \$pidfile)
rm \$pidfile
}" > /etc/init.d/whoogle
chmod 755 /etc/init.d/whoogle
rc-service -q whoogle start
rc-update add -q whoogle default
msg_ok "Installed Alpine-Whoogle"
motd_ssh
root