To change the script, please delete the file using this command, and then go through the topic again.
sudo rm /var/www/new/ehcp/scripts/updateehcp.sh
IMPORTANT INFORMATION REGARDING EHCP FORCE UPDATE
When it comes to updating your EHCP force installation, Please DO NOT use the update script from the EHCP force website as this will undo some of the changes we have made in other posts.
You must use the upgrade script provided later in this topic to update EHCP force.
It is important that you keep your server updated with the most recent version of EHCP force.
To check if a new version has been released since your last updated (or installed) EHCP force check this link.
https://ehcpforce.tk/forums/index.php?topic=15.0
Ok, lets do this.
We are going to create an update script file so in the future we can use a single line to update EHCP force.
Logon to your server using your PC and putty.
Issue this command to create a new script file.
sudo vi /var/www/new/ehcp/scripts/updateehcp.sh
Press I for insert, and paste in this code
Code: Select all
#!/bin/bash
#
# EHCP force update script by Rob Swan (WA) V.1.09.01
#
#Check for root-----------------------------------------------------------------
ROOTUID="0"
if [ "$(id -u)" -ne "$ROOTUID" ] ; then
echo "This script must be executed with root privileges."
exit 1
fi
# Check for Ubuntu updates ----------------------------------------------------
apt-get update
apt-get upgrade --assume-yes
apt-get dist-upgrade --assume-yes
#-------------------------------------------------------------------------------
#
# Protect the Squirrelmail installation -----------------------------------------
mv /var/www/new/ehcp/webmail2 /var/www/new/ehcp/hidemail2
#-------------------------------------------------------------------------------
#
#
# Run the EHCP force update----------------------------------------------------
mkdir -p ~/Downloads
sudo apt-get -y install git
cd ~/Downloads
if [ -e "ehcp" ]; then
rm -rf "ehcp"
fi
git clone "https://github.com/earnolmartin/EHCP-Force-Edition.git" "ehcp"
cd ehcp
cd ehcp
bash "ehcpforceupdate.sh" "update"
#-------------------------------------------------------------------------------
#
# Re-activate Squirrelmail------------------------------------------------------
rm -rf /var/www/new/ehcp/webmail2
mv /var/www/new/ehcp/hidemail2 /var/www/new/ehcp/webmail2
chown root:www-data -R /var/www/new/ehcp/webmail2
chmod 754 -R /var/www/new/ehcp/webmail2
chown ftp:www-data -R /var/www/new/ehcp/webmail2/data
#-------------------------------------------------------------------------------
#
#
#Clean Up-----------------------------------------------------------------------
apt autoremove --assume-yes >/dev/null 2>&1
apt autoclean --assume-yes >/dev/null 2>&1
#-------------------------------------------------------------------------------
#
#Tell the user its time to reboot-----------------------------------------------
echo ""
read -p "Update Done, Press any key to reboot this server." -n1 -s
echo ""
shutdown -r now
#-------------------------------------------------------------------------------
#
#ALL DONE!
Save and exit (Escape :w (enter) :q (enter))
As this is a new file we have to give it permission to execute so issue this command.
sudo chmod +x /var/www/new/ehcp/scripts/updateehcp.sh
Ok, that is our update script created (we don’t need to repeat that step when we update EHCP force in the future).
So from now anytime EHCP force needs updating simple issue the following command.
sudo /var/www/new/ehcp/scripts/updateehcp.sh
During the update process you may see this screen or similar.
If you do see this screen, use the up and down arrow to highlight each package, then press the space bar to put a * in the brackets.
Make sure each package in the list is selected with a star in the brackets.
Next, press the TAB button on your keyboard to select the Ok option.
Then press enter.
You may see a longer version of the same screen, with a scroll bar to the right.
In this case you need to do the same thing and select everything in the list, but you must keep pressing the down arrow until the scroll bar is at the end.
Then press TAB to highlight the Ok option, and then enter.
In the future there may be other screens that pop up, if I see any new ones, I will add them to this topic.
When the update completes, you be asked to press any key to reboot, so please do so.
Job done!