Merge pull request #2 from sbennell/Testing

This commit is contained in:
Stewart Bennell 2021-09-24 10:45:20 +10:00 committed by GitHub
commit 5ff5b7c228
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 39 deletions

View File

@ -1,6 +1,6 @@
# SetupProxmox # SetupProxmox
Removes subscription dialogs, replaces enterprise repository with non-subscription repository, replaces branding, Update and upgrade system, Add Benenell IT SSh Key and Configure Postfix to use Office365 SMTP Relay. Tested on PVE 5.0 to 7.0 Removes subscription dialogs, replaces enterprise repository with non-subscription repository, apt Update and apt upgrade system, Add Benenell IT SSh Key and Configure Postfix to use Office365 SMTP Relay. Tested on PVE 5.0 to 7.0-11
Use at your own risk! Read the script before you run it. Use at your own risk! Read the script before you run it.
@ -12,10 +12,10 @@ Use at your own risk! Read the script before you run it.
```bash ```bash
# if root # if root
wget -qO - https://raw.githubusercontent.com/sbennell/SetupProxmox/master/patch.sh -c -O patch.sh && bash patch.sh && rm patch.sh wget -qO - https://raw.githubusercontent.com/sbennell/SetupProxmox/Testing/patch.sh -c -O patch.sh && bash patch.sh && rm patch.sh
# if non-root # if non-root
wget -qO - https://raw.githubusercontent.com/sbennell/SetupProxmox/master/patch.sh -c -O patch.sh && sudo bash patch.sh && rm patch.sh wget -qO - https://raw.githubusercontent.com/sbennell/SetupProxmox/Testing/patch.sh -c -O patch.sh && sudo bash patch.sh && rm patch.sh
``` ```

View File

@ -1,17 +1,19 @@
#!/usr/bin/env bash #!/usr/bin/env bash
branches=Testing
mkdir -p /usr/share/pve-patch/{images,scripts} mkdir -p /usr/share/pve-patch/{images,scripts}
echo "- Proxmox Setup Script Testing Version..."
echo "- patch `pveversion`..." echo "- patch `pveversion`..."
echo "- download and copy files..." echo "- download and copy files..."
rm -f /usr/share/pve-patch/images/{favicon.ico,logo-128.png,proxmox_logo.png} rm -f /usr/share/pve-patch/images/{favicon.ico,logo-128.png,proxmox_logo.png}
wget -nc -qP /usr/share/pve-patch/images/ https://raw.githubusercontent.com/sbennell/pve-patch/master/images/favicon.ico wget -nc -qP /usr/share/pve-patch/images/ https://raw.githubusercontent.com/sbennell/pve-patch/$branches/images/favicon.ico
wget -nc -qP /usr/share/pve-patch/images/ https://raw.githubusercontent.com/sbennell/pve-patch/master/images/logo-128.png wget -nc -qP /usr/share/pve-patch/images/ https://raw.githubusercontent.com/sbennell/pve-patch/$branches/images/logo-128.png
wget -nc -qP /usr/share/pve-patch/images/ https://raw.githubusercontent.com/sbennell/pve-patch/master/images/proxmox_logo.png wget -nc -qP /usr/share/pve-patch/images/ https://raw.githubusercontent.com/sbennell/pve-patch/$branches/images/proxmox_logo.png
rm -f /usr/share/pve-patch/scripts/{90pvepatch,apply.sh,pvebanner} rm -f /usr/share/pve-patch/scripts/{90pvepatch,apply.sh,pvebanner}
wget -qP /usr/share/pve-patch/scripts/ https://raw.githubusercontent.com/sbennell/pve-patch/master/scripts/{90pvepatch,apply.sh,pvebanner} wget -qP /usr/share/pve-patch/scripts/ https://raw.githubusercontent.com/sbennell/pve-patch/$branches/scripts/{90pvepatch,apply.sh,pvebanner}
chmod -R a+x /usr/share/pve-patch/scripts chmod -R a+x /usr/share/pve-patch/scripts
cp -f /usr/share/pve-patch/scripts/90pvepatch /etc/apt/apt.conf.d/90pvepatch cp -f /usr/share/pve-patch/scripts/90pvepatch /etc/apt/apt.conf.d/90pvepatch
cp -f /usr/share/pve-patch/scripts/pvebanner /usr/bin/pvebanner
chmod +x /usr/share/pve-patch/scripts/apply.sh chmod +x /usr/share/pve-patch/scripts/apply.sh
/usr/share/pve-patch/scripts/apply.sh /usr/share/pve-patch/scripts/apply.sh
@ -21,15 +23,16 @@ curl -s https://api.github.com/repos/sbennell/pve-fake-subscription/releases/lat
| tr -d \" \ | tr -d \" \
| wget -qi - | wget -qi -
dpkg -i pve-fake-subscription_*.deb dpkg -i pve-fake-subscription_*.deb
rm -f pve-fake-subscription_*.deb
echo "127.0.0.1 shop.maurer-it.com" | sudo tee -a /etc/hosts echo "127.0.0.1 shop.maurer-it.com" | tee -a /etc/hosts
echo "- Apt Update and upgrade system..." echo "- Apt Update and upgrade system..."
echo "" echo ""
apt update apt update
apt update && apt dist-upgrade -y apt update && apt dist-upgrade -y
echo "- Install Packages." echo "- Install Packages."
apt install ifupdown2 sasl2-bin mailutils libsasl2-modules -y curl apt install ifupdown2 sasl2-bin mailutils libsasl2-modules curl -y
echo "- Adding SSH Key - Bennell IT..." echo "- Adding SSH Key - Bennell IT..."
mkdir -p ~/.ssh mkdir -p ~/.ssh
@ -71,5 +74,3 @@ echo "IP Address: $IP" >> /etc/postfix/emailsetupinfo.txt
sendmail -v server@lab-network.xyz < /etc/postfix/emailsetupinfo.txt sendmail -v server@lab-network.xyz < /etc/postfix/emailsetupinfo.txt
echo "- done!" echo "- done!"
echo "- done!"

View File

@ -13,14 +13,6 @@ function pve_patch() {
} }
pve_patch pve_patch
cp -f /usr/share/pve-patch/scripts/pvebanner /usr/bin/pvebanner
echo "- Updating logon banner..." echo "- Updating logon banner..."
/usr/bin/pvebanner /usr/bin/pvebanner
echo "- Updating Name..."
x="Proxmox Virtual Environment"
y="Bennell IT Virtual Environment"
w="Proxmox VE"
e="Bennell IT VE "
sed -i -e "s/$x/$y/g" /usr/share/pve-manager/index.html.tpl
sed -i -e "s/$x/$y/g" /usr/share/pve-manager/touch/index.html.tpl
sed -i -e "s/$w/$e/g" /usr/share/pve-manager/js/pvemanagerlib.js

View File

@ -3,18 +3,21 @@
use strict; use strict;
use PVE::INotify; use PVE::INotify;
use PVE::Cluster; use PVE::Cluster;
use Sys::Hostname;
my $nodename = PVE::INotify::nodename(); my $nodename = PVE::INotify::nodename();
my $localip = PVE::Cluster::remote_node_ip($nodename, 1); my $localip = PVE::Cluster::remote_node_ip($nodename, 1);
#my $lastupdate = `date +%m/%d/%Y" "%l:%M:%S" "%p`;
my $xline = '-' x 78; my $year = `date +%Y`;
my $hostname = hostname;
my $xline = '*' x 78;
my $banner = ''; my $banner = '';
if ($localip) { if ($localip) {
$banner .= <<__EOBANNER; $banner .= <<__EOBANNER;
$xline $xline
888888b. 888 888 8888888 88888888888 888888b. 888 888 8888888 88888888888
888 "88b 888 888 888 888 888 "88b 888 888 888 888
888 .88P 888 888 888 888 888 .88P 888 888 888 888
@ -23,14 +26,12 @@ $xline
888 888 88888888 888 888 888 888 88888888 888 888 888 888 888 888 88888888 888 888 888 888 88888888 888 888 888 888
888 d88P Y8b. 888 888 888 888 Y8b. 888 888 888 888 888 d88P Y8b. 888 888 888 888 Y8b. 888 888 888 888
8888888P" "Y8888 888 888 888 888 "Y8888 888 888 8888888 888 8888888P" "Y8888 888 888 888 888 "Y8888 888 888 8888888 888
www.bennellit.com.au 2020 www.bennellit.com.au $year
$xline $xline
Welcome to the Bennell IT Virtual Environment. Welcome to $hostname Server.
Please use your web browser to configure this server - connect to: Please use your web browser to configure this server
connect to https://${localip}:8006/
https://${localip}:8006/
$xline $xline
__EOBANNER __EOBANNER
} }