2017-09-28 20:00:51 +00:00
|
|
|
|
#!/bin/bash
|
2017-10-05 22:53:35 +00:00
|
|
|
|
|
2018-08-21 20:31:04 +00:00
|
|
|
|
# Some global vars
|
2017-10-05 19:13:58 +00:00
|
|
|
|
myCONFIGFILE="/opt/tpot/etc/tpot.yml"
|
2018-01-10 17:13:48 +00:00
|
|
|
|
myCOMPOSEPATH="/opt/tpot/etc/compose"
|
2017-10-05 19:13:58 +00:00
|
|
|
|
myRED="[0;31m"
|
|
|
|
|
myGREEN="[0;32m"
|
|
|
|
|
myWHITE="[0;0m"
|
|
|
|
|
myBLUE="[0;34m"
|
|
|
|
|
|
|
|
|
|
# Check for existing tpot.yml
|
|
|
|
|
function fuCONFIGCHECK () {
|
|
|
|
|
echo "### Checking for T-Pot configuration file ..."
|
2020-01-28 17:52:44 +00:00
|
|
|
|
if ! [ -L $myCONFIGFILE ];
|
2017-10-05 19:13:58 +00:00
|
|
|
|
then
|
2020-01-28 17:52:44 +00:00
|
|
|
|
echo -n "###### $myBLUE$myCONFIGFILE$myWHITE "
|
|
|
|
|
myFILE=$(head -n 1 $myCONFIGFILE | tr -d "()" | tr [:upper:] [:lower:] | awk '{ print $3 }')
|
|
|
|
|
myFILE+=".yml"
|
|
|
|
|
echo "[ $myRED""NOT OK""$myWHITE ] - Broken symlink, trying to reset to '$myFILE'."
|
|
|
|
|
rm -rf $myCONFIGFILE
|
|
|
|
|
ln -s $myCOMPOSEPATH/$myFILE $myCONFIGFILE
|
|
|
|
|
fi
|
|
|
|
|
if [ -L $myCONFIGFILE ];
|
|
|
|
|
then
|
|
|
|
|
echo "###### $myBLUE$myCONFIGFILE$myWHITE [ $myGREEN""OK""$myWHITE ]"
|
2017-10-05 19:13:58 +00:00
|
|
|
|
else
|
2020-01-28 17:52:44 +00:00
|
|
|
|
echo "[ $myRED""NOT OK""$myWHITE ] - Broken symlink and / or restore failed."
|
|
|
|
|
echo "Please create a link to your desired config i.e. 'ln -s /opt/tpot/etc/compose/standard.yml /opt/tpot/etc/tpot.yml'."
|
|
|
|
|
exit
|
2017-10-05 19:13:58 +00:00
|
|
|
|
fi
|
2018-08-21 15:21:45 +00:00
|
|
|
|
echo
|
2017-10-05 19:13:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Let's test the internet connection
|
|
|
|
|
function fuCHECKINET () {
|
|
|
|
|
mySITES=$1
|
|
|
|
|
echo "### Now checking availability of ..."
|
|
|
|
|
for i in $mySITES;
|
|
|
|
|
do
|
|
|
|
|
echo -n "###### $myBLUE$i$myWHITE "
|
|
|
|
|
curl --connect-timeout 5 -IsS $i 2>&1>/dev/null
|
|
|
|
|
if [ $? -ne 0 ];
|
|
|
|
|
then
|
2018-08-20 15:06:10 +00:00
|
|
|
|
echo
|
|
|
|
|
echo "###### $myBLUE""Error - Internet connection test failed.""$myWHITE"" [ $myRED""NOT OK""$myWHITE ]"
|
|
|
|
|
echo "Exiting.""$myWHITE"
|
2017-10-05 19:13:58 +00:00
|
|
|
|
echo
|
|
|
|
|
exit 1
|
|
|
|
|
else
|
2018-08-20 15:06:10 +00:00
|
|
|
|
echo "[ $myGREEN"OK"$myWHITE ]"
|
2017-10-05 19:13:58 +00:00
|
|
|
|
fi
|
|
|
|
|
done;
|
2018-08-21 15:21:45 +00:00
|
|
|
|
echo
|
2017-10-05 19:13:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-08-20 15:06:10 +00:00
|
|
|
|
# Update
|
2017-10-05 22:02:02 +00:00
|
|
|
|
function fuSELFUPDATE () {
|
2017-10-05 22:34:41 +00:00
|
|
|
|
echo "### Now checking for newer files in repository ..."
|
2018-08-20 15:06:10 +00:00
|
|
|
|
git fetch --all
|
2017-10-05 22:34:41 +00:00
|
|
|
|
myREMOTESTAT=$(git status | grep -c "up-to-date")
|
|
|
|
|
if [ "$myREMOTESTAT" != "0" ];
|
|
|
|
|
then
|
2018-08-20 15:06:10 +00:00
|
|
|
|
echo "###### $myBLUE""No updates found in repository.""$myWHITE"
|
2017-10-05 22:34:41 +00:00
|
|
|
|
return
|
|
|
|
|
fi
|
2020-09-04 16:27:05 +00:00
|
|
|
|
myRESULT=$(git diff --name-only origin/master | grep update.sh)
|
2017-10-05 22:02:02 +00:00
|
|
|
|
if [ "$myRESULT" == "update.sh" ];
|
|
|
|
|
then
|
2018-08-21 20:27:53 +00:00
|
|
|
|
echo "###### $myBLUE""Found newer version, will be pulling updates and restart myself.""$myWHITE"
|
2018-08-20 15:06:10 +00:00
|
|
|
|
git reset --hard
|
2017-10-13 21:53:21 +00:00
|
|
|
|
git pull --force
|
2018-08-21 15:21:45 +00:00
|
|
|
|
exec "$1" "$2"
|
|
|
|
|
exit 1
|
2018-08-21 20:27:53 +00:00
|
|
|
|
else
|
|
|
|
|
echo "###### $myBLUE""Pulling updates from repository.""$myWHITE"
|
|
|
|
|
git reset --hard
|
|
|
|
|
git pull --force
|
2017-10-19 09:02:59 +00:00
|
|
|
|
fi
|
2018-08-21 15:21:45 +00:00
|
|
|
|
echo
|
2017-10-19 09:02:59 +00:00
|
|
|
|
}
|
2017-10-05 22:02:02 +00:00
|
|
|
|
|
2018-08-08 15:02:56 +00:00
|
|
|
|
# Let's check for version
|
|
|
|
|
function fuCHECK_VERSION () {
|
2019-02-12 19:29:13 +00:00
|
|
|
|
local myMINVERSION="19.03.0"
|
2021-02-22 11:21:18 +00:00
|
|
|
|
local myMASTERVERSION="20.06.2"
|
2018-08-08 15:02:56 +00:00
|
|
|
|
echo
|
2019-04-01 14:34:50 +00:00
|
|
|
|
echo "### Checking for Release ID"
|
|
|
|
|
myRELEASE=$(lsb_release -i | grep Debian -c)
|
|
|
|
|
if [ "$myRELEASE" == "0" ]
|
|
|
|
|
then
|
|
|
|
|
echo "###### This version of T-Pot cannot be upgraded automatically. Please run a fresh install.$myWHITE"" [ $myRED""NOT OK""$myWHITE ]"
|
|
|
|
|
exit
|
|
|
|
|
fi
|
2018-08-20 15:06:10 +00:00
|
|
|
|
echo "### Checking for version tag ..."
|
2018-08-08 15:02:56 +00:00
|
|
|
|
if [ -f "version" ];
|
|
|
|
|
then
|
|
|
|
|
myVERSION=$(cat version)
|
|
|
|
|
if [[ "$myVERSION" > "$myMINVERSION" || "$myVERSION" == "$myMINVERSION" ]] && [[ "$myVERSION" < "$myMASTERVERSION" || "$myVERSION" == "$myMASTERVERSION" ]]
|
|
|
|
|
then
|
2018-08-20 15:06:10 +00:00
|
|
|
|
echo "###### $myBLUE$myVERSION is eligible for the update procedure.$myWHITE"" [ $myGREEN""OK""$myWHITE ]"
|
2018-08-08 15:02:56 +00:00
|
|
|
|
else
|
2018-08-20 15:06:10 +00:00
|
|
|
|
echo "###### $myBLUE $myVERSION cannot be upgraded automatically. Please run a fresh install.$myWHITE"" [ $myRED""NOT OK""$myWHITE ]"
|
|
|
|
|
exit
|
2018-08-08 15:02:56 +00:00
|
|
|
|
fi
|
|
|
|
|
else
|
2018-08-20 15:06:10 +00:00
|
|
|
|
echo "###### $myBLUE""Unable to determine version. Please run 'update.sh' from within '/opt/tpot'.""$myWHITE"" [ $myRED""NOT OK""$myWHITE ]"
|
2018-08-08 15:02:56 +00:00
|
|
|
|
exit
|
|
|
|
|
fi
|
2018-08-21 15:21:45 +00:00
|
|
|
|
echo
|
2018-08-08 15:02:56 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-08-20 15:06:10 +00:00
|
|
|
|
|
|
|
|
|
# Stop T-Pot to avoid race conditions with running containers with regard to the current T-Pot config
|
|
|
|
|
function fuSTOP_TPOT () {
|
|
|
|
|
echo "### Need to stop T-Pot ..."
|
|
|
|
|
echo -n "###### $myBLUE Now stopping T-Pot.$myWHITE "
|
|
|
|
|
systemctl stop tpot
|
|
|
|
|
if [ $? -ne 0 ];
|
|
|
|
|
then
|
|
|
|
|
echo " [ $myRED""NOT OK""$myWHITE ]"
|
|
|
|
|
echo "###### $myBLUE""Could not stop T-Pot.""$myWHITE"" [ $myRED""NOT OK""$myWHITE ]"
|
|
|
|
|
echo "Exiting.""$myWHITE"
|
|
|
|
|
echo
|
|
|
|
|
exit 1
|
|
|
|
|
else
|
|
|
|
|
echo "[ $myGREEN"OK"$myWHITE ]"
|
2018-09-12 13:42:00 +00:00
|
|
|
|
echo "###### $myBLUE Now cleaning up containers.$myWHITE "
|
2018-09-12 14:08:34 +00:00
|
|
|
|
if [ "$(docker ps -aq)" != "" ];
|
|
|
|
|
then
|
|
|
|
|
docker stop $(docker ps -aq)
|
|
|
|
|
docker rm $(docker ps -aq)
|
|
|
|
|
fi
|
2017-09-28 20:00:51 +00:00
|
|
|
|
fi
|
2018-08-21 15:21:45 +00:00
|
|
|
|
echo
|
2018-08-20 15:06:10 +00:00
|
|
|
|
}
|
2017-10-05 21:02:36 +00:00
|
|
|
|
|
2018-08-20 15:06:10 +00:00
|
|
|
|
# Backup
|
|
|
|
|
function fuBACKUP () {
|
|
|
|
|
local myARCHIVE="/root/$(date +%Y%m%d%H%M)_tpot_backup.tgz"
|
|
|
|
|
local myPATH=$PWD
|
|
|
|
|
echo "### Create a backup, just in case ... "
|
|
|
|
|
echo -n "###### $myBLUE Building archive in $myARCHIVE $myWHITE"
|
|
|
|
|
cd /opt/tpot
|
|
|
|
|
tar cvfz $myARCHIVE * 2>&1>/dev/null
|
|
|
|
|
if [ $? -ne 0 ];
|
|
|
|
|
then
|
|
|
|
|
echo " [ $myRED""NOT OK""$myWHITE ]"
|
|
|
|
|
echo "###### $myBLUE""Something went wrong.""$myWHITE"" [ $myRED""NOT OK""$myWHITE ]"
|
|
|
|
|
echo "Exiting.""$myWHITE"
|
|
|
|
|
echo
|
|
|
|
|
cd $myPATH
|
|
|
|
|
exit 1
|
|
|
|
|
else
|
|
|
|
|
echo "[ $myGREEN"OK"$myWHITE ]"
|
|
|
|
|
cd $myPATH
|
|
|
|
|
fi
|
2018-08-21 15:21:45 +00:00
|
|
|
|
echo
|
2018-08-20 15:06:10 +00:00
|
|
|
|
}
|
2017-10-05 22:34:41 +00:00
|
|
|
|
|
2018-11-21 13:44:13 +00:00
|
|
|
|
# Remove old images for specific tag
|
|
|
|
|
function fuREMOVEOLDIMAGES () {
|
|
|
|
|
local myOLDTAG=$1
|
|
|
|
|
local myOLDIMAGES=$(docker images | grep -c "$myOLDTAG")
|
|
|
|
|
if [ "$myOLDIMAGES" -gt "0" ];
|
|
|
|
|
then
|
|
|
|
|
echo "### Removing old docker images."
|
|
|
|
|
docker rmi $(docker images | grep "$myOLDTAG" | awk '{print $3}')
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-20 15:06:10 +00:00
|
|
|
|
# Let's load docker images in parallel
|
|
|
|
|
function fuPULLIMAGES {
|
|
|
|
|
local myTPOTCOMPOSE="/opt/tpot/etc/tpot.yml"
|
|
|
|
|
for name in $(cat $myTPOTCOMPOSE | grep -v '#' | grep image | cut -d'"' -f2 | uniq)
|
|
|
|
|
do
|
|
|
|
|
docker pull $name &
|
|
|
|
|
done
|
|
|
|
|
wait
|
2018-08-21 15:21:45 +00:00
|
|
|
|
echo
|
2018-08-20 15:06:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function fuUPDATER () {
|
2019-02-28 19:22:30 +00:00
|
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
2019-04-03 13:39:40 +00:00
|
|
|
|
echo "### Installing apt-fast"
|
|
|
|
|
/bin/bash -c "$(curl -sL https://raw.githubusercontent.com/ilikenwf/apt-fast/master/quick-install.sh)"
|
2020-12-28 10:40:19 +00:00
|
|
|
|
local myPACKAGES="aria2 apache2-utils apparmor apt-transport-https aufs-tools bash-completion build-essential ca-certificates cgroupfs-mount cockpit cockpit-docker console-setup console-setup-linux cracklib-runtime curl debconf-utils dialog dnsutils docker.io docker-compose ethtool fail2ban figlet genisoimage git glances grc haveged html2text htop iptables iw jq kbd libcrack2 libltdl7 libpam-google-authenticator man mosh multitail net-tools npm ntp openssh-server openssl pass pigz prips software-properties-common syslinux psmisc pv python3-elasticsearch-curator python3-pip toilet unattended-upgrades unzip vim wget wireless-tools wpasupplicant"
|
2020-06-08 21:56:16 +00:00
|
|
|
|
# Remove purge in the future
|
|
|
|
|
echo "### Removing repository based install of elasticsearch-curator"
|
|
|
|
|
apt-get purge elasticsearch-curator -y
|
2020-03-04 12:12:12 +00:00
|
|
|
|
hash -r
|
2018-08-20 15:06:10 +00:00
|
|
|
|
echo "### Now upgrading packages ..."
|
2018-11-15 12:55:04 +00:00
|
|
|
|
dpkg --configure -a
|
2019-04-04 06:55:59 +00:00
|
|
|
|
apt-fast -y autoclean
|
|
|
|
|
apt-fast -y autoremove
|
2019-04-03 13:39:40 +00:00
|
|
|
|
apt-fast update
|
|
|
|
|
apt-fast -y install $myPACKAGES
|
2018-11-15 11:55:37 +00:00
|
|
|
|
|
|
|
|
|
# Some updates require interactive attention, and the following settings will override that.
|
|
|
|
|
echo "docker.io docker.io/restart boolean true" | debconf-set-selections -v
|
|
|
|
|
echo "debconf debconf/frontend select noninteractive" | debconf-set-selections -v
|
2019-04-03 13:39:40 +00:00
|
|
|
|
apt-fast -y dist-upgrade -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --force-yes
|
2018-11-15 12:55:04 +00:00
|
|
|
|
dpkg --configure -a
|
2020-06-09 19:08:21 +00:00
|
|
|
|
npm cache clean --force
|
2020-03-15 21:24:01 +00:00
|
|
|
|
npm install elasticdump -g
|
2020-03-04 12:12:12 +00:00
|
|
|
|
pip3 install --upgrade yq
|
2020-06-08 21:56:16 +00:00
|
|
|
|
# Remove --force switch in the future ...
|
2020-06-09 19:08:21 +00:00
|
|
|
|
pip3 install elasticsearch-curator --force
|
2019-10-28 14:39:10 +00:00
|
|
|
|
hash -r
|
2019-10-26 10:40:09 +00:00
|
|
|
|
echo "### Removing and holding back problematic packages ..."
|
2020-06-08 21:56:16 +00:00
|
|
|
|
apt-fast -y purge exim4-base mailutils pcp cockpit-pcp elasticsearch-curator
|
|
|
|
|
apt-mark hold exim4-base mailutils pcp cockpit-pcp elasticsearch-curator
|
2017-10-05 19:13:58 +00:00
|
|
|
|
echo
|
2017-10-05 21:02:36 +00:00
|
|
|
|
|
2018-08-20 15:06:10 +00:00
|
|
|
|
echo "### Now replacing T-Pot related config files on host"
|
|
|
|
|
cp host/etc/systemd/* /etc/systemd/system/
|
2018-08-21 20:17:53 +00:00
|
|
|
|
systemctl daemon-reload
|
2017-10-05 22:02:02 +00:00
|
|
|
|
echo
|
|
|
|
|
|
2018-11-26 10:35:03 +00:00
|
|
|
|
# Ensure some defaults
|
|
|
|
|
echo "### Ensure some T-Pot defaults with regard to some folders, permissions and configs."
|
|
|
|
|
sed -i '/^port/Id' /etc/ssh/sshd_config
|
|
|
|
|
echo "Port 64295" >> /etc/ssh/sshd_config
|
|
|
|
|
echo
|
|
|
|
|
|
|
|
|
|
### Ensure creation of T-Pot related folders, just in case
|
2020-06-08 21:56:16 +00:00
|
|
|
|
mkdir -vp /data/adbhoney/{downloads,log} \
|
2018-12-05 16:59:08 +00:00
|
|
|
|
/data/ciscoasa/log \
|
2018-11-26 10:35:03 +00:00
|
|
|
|
/data/conpot/log \
|
2020-01-15 13:19:38 +00:00
|
|
|
|
/data/citrixhoneypot/logs \
|
2020-06-08 21:56:16 +00:00
|
|
|
|
/data/cowrie/{downloads,keys,misc,log,log/tty} \
|
2020-06-28 20:03:14 +00:00
|
|
|
|
/data/dicompot/{images,log} \
|
2020-06-08 21:56:16 +00:00
|
|
|
|
/data/dionaea/{log,bistreams,binaries,rtp,roots,roots/ftp,roots/tftp,roots/www,roots/upnp} \
|
2018-11-26 10:35:03 +00:00
|
|
|
|
/data/elasticpot/log \
|
2020-06-08 21:56:16 +00:00
|
|
|
|
/data/elk/{data,log} \
|
2019-06-03 10:22:07 +00:00
|
|
|
|
/data/fatt/log \
|
2020-06-08 21:56:16 +00:00
|
|
|
|
/data/honeytrap/{log,attacks,downloads} \
|
2018-11-26 10:35:03 +00:00
|
|
|
|
/data/glutton/log \
|
|
|
|
|
/data/heralding/log \
|
2019-03-10 18:15:59 +00:00
|
|
|
|
/data/honeypy/log \
|
2020-06-19 11:54:50 +00:00
|
|
|
|
/data/honeysap/log \
|
2020-08-24 21:36:08 +00:00
|
|
|
|
/data/ipphoney/log \
|
2018-11-26 10:35:03 +00:00
|
|
|
|
/data/mailoney/log \
|
|
|
|
|
/data/medpot/log \
|
2020-06-08 21:56:16 +00:00
|
|
|
|
/data/nginx/{log,heimdall} \
|
2018-11-26 10:35:03 +00:00
|
|
|
|
/data/emobility/log \
|
|
|
|
|
/data/ews/conf \
|
|
|
|
|
/data/rdpy/log \
|
|
|
|
|
/data/spiderfoot \
|
2020-06-08 21:56:16 +00:00
|
|
|
|
/data/suricata/log \
|
|
|
|
|
/data/tanner/{log,files} \
|
|
|
|
|
/data/p0f/log \
|
|
|
|
|
/home/tsec/.ssh/
|
2018-11-26 10:35:03 +00:00
|
|
|
|
|
|
|
|
|
### Let's take care of some files and permissions
|
2019-05-08 11:16:48 +00:00
|
|
|
|
chmod 770 -R /data
|
2018-11-26 10:35:03 +00:00
|
|
|
|
chown tpot:tpot -R /data
|
|
|
|
|
chmod 644 -R /data/nginx/conf
|
|
|
|
|
chmod 644 -R /data/nginx/cert
|
|
|
|
|
|
2018-08-20 15:06:10 +00:00
|
|
|
|
echo "### Now pulling latest docker images"
|
2018-08-24 17:56:14 +00:00
|
|
|
|
echo "######$myBLUE This might take a while, please be patient!$myWHITE"
|
|
|
|
|
fuPULLIMAGES 2>&1>/dev/null
|
2017-09-28 20:00:51 +00:00
|
|
|
|
|
2020-06-29 10:45:33 +00:00
|
|
|
|
#fuREMOVEOLDIMAGES "1903"
|
2018-08-20 15:06:10 +00:00
|
|
|
|
echo "### If you made changes to tpot.yml please ensure to add them again."
|
|
|
|
|
echo "### We stored the previous version as backup in /root/."
|
2019-03-28 11:27:50 +00:00
|
|
|
|
echo "### Some updates may need an import of the latest Kibana objects as well."
|
|
|
|
|
echo "### Download the latest objects here if they recently changed:"
|
2020-09-04 13:01:21 +00:00
|
|
|
|
echo "### https://raw.githubusercontent.com/telekom-security/tpotce/master/etc/objects/kibana_export.ndjson.zip"
|
2019-03-28 11:27:50 +00:00
|
|
|
|
echo "### Export and import the objects easily through the Kibana WebUI:"
|
|
|
|
|
echo "### Go to Kibana > Management > Saved Objects > Export / Import"
|
2020-06-29 10:45:33 +00:00
|
|
|
|
echo "### Or use the command:"
|
|
|
|
|
echo "### import_kibana-objects.sh /opt/tpot/etc/objects/kibana-objects.tgz"
|
|
|
|
|
echo "### All objects will be overwritten upon import, make sure to run an export first if you made changes."
|
2018-08-20 15:06:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-04-23 19:37:51 +00:00
|
|
|
|
function fuRESTORE_EWSCFG () {
|
2020-01-28 17:52:44 +00:00
|
|
|
|
if [ -f '/data/ews/conf/ews.cfg' ] && ! grep 'ews.cfg' $myCONFIGFILE > /dev/null; then
|
2019-05-16 07:26:42 +00:00
|
|
|
|
echo
|
2019-04-23 19:37:51 +00:00
|
|
|
|
echo "### Restoring volume mount for ews.cfg in tpot.yml"
|
2020-01-28 17:52:44 +00:00
|
|
|
|
sed -i --follow-symlinks '/\/opt\/ewsposter\/ews.ip/a\\ \ \ \ \ - /data/ews/conf/ews.cfg:/opt/ewsposter/ews.cfg' $myCONFIGFILE
|
2019-04-23 19:37:51 +00:00
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-16 01:20:50 +00:00
|
|
|
|
function fuRESTORE_HPFEEDS () {
|
|
|
|
|
if [ -f '/data/ews/conf/hpfeeds.cfg' ]; then
|
2019-05-16 07:26:42 +00:00
|
|
|
|
echo
|
2019-05-16 01:20:50 +00:00
|
|
|
|
echo "### Restoring HPFEEDS in tpot.yml"
|
|
|
|
|
./bin/hpfeeds_optin.sh --conf=/data/ews/conf/hpfeeds.cfg
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-20 15:06:10 +00:00
|
|
|
|
|
|
|
|
|
################
|
|
|
|
|
# Main section #
|
|
|
|
|
################
|
|
|
|
|
|
|
|
|
|
# Got root?
|
|
|
|
|
myWHOAMI=$(whoami)
|
|
|
|
|
if [ "$myWHOAMI" != "root" ]
|
|
|
|
|
then
|
|
|
|
|
echo "Need to run as root ..."
|
|
|
|
|
exit
|
|
|
|
|
fi
|
2017-09-28 20:00:51 +00:00
|
|
|
|
|
2018-08-20 15:06:10 +00:00
|
|
|
|
# Only run with command switch
|
|
|
|
|
if [ "$1" != "-y" ]; then
|
2018-08-21 15:33:14 +00:00
|
|
|
|
echo "This script will update / upgrade all T-Pot related scripts, tools and packages to the latest versions."
|
|
|
|
|
echo "A backup of /opt/tpot will be written to /root. If you are unsure, you should save your work."
|
|
|
|
|
echo "This is a beta feature and only recommended for experienced users."
|
|
|
|
|
echo "If you understand the involved risks feel free to run this script with the '-y' switch."
|
2018-08-20 15:06:10 +00:00
|
|
|
|
echo
|
|
|
|
|
exit
|
|
|
|
|
fi
|
2018-01-10 17:29:02 +00:00
|
|
|
|
|
2018-08-20 15:06:10 +00:00
|
|
|
|
fuCHECK_VERSION
|
|
|
|
|
fuCONFIGCHECK
|
2019-02-12 19:29:13 +00:00
|
|
|
|
fuCHECKINET "https://index.docker.io https://github.com https://pypi.python.org https://debian.org"
|
2018-08-20 15:06:10 +00:00
|
|
|
|
fuSTOP_TPOT
|
|
|
|
|
fuBACKUP
|
|
|
|
|
fuSELFUPDATE "$0" "$@"
|
|
|
|
|
fuUPDATER
|
2019-04-23 19:37:51 +00:00
|
|
|
|
fuRESTORE_EWSCFG
|
2019-05-16 01:20:50 +00:00
|
|
|
|
fuRESTORE_HPFEEDS
|
2019-05-16 07:19:50 +00:00
|
|
|
|
|
|
|
|
|
echo
|
2020-06-29 10:45:33 +00:00
|
|
|
|
echo "### Done."
|
2019-05-16 07:19:50 +00:00
|
|
|
|
echo
|