Update update.sh

chunking
m0rv4i 2018-09-26 13:47:32 +01:00
parent db30db9705
commit e314dda90d
1 changed files with 15 additions and 8 deletions

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# Update PoshC2
echo ""
@ -15,19 +15,26 @@ echo ""
echo "[+] Updating PoshC2_Python"
echo ""
ROOTDIR=`dirname "$0"`
if [ ! -d "$ROOTDIR" ]; then
ROOTDIR="/opt/PoshC2_Python/"
fi
pushd "$ROOTDIR" > /dev/null
# Backup config
echo "[+] Backup Config.py"
mv /opt/PoshC2_Python/Config.py /tmp/Config.py
echo "[+] Backup Config"
git stash > /dev/null
# Install requirements for PoshC2_Python
echo ""
echo "[+] Performing git pull on /opt/PoshC2_Python/"
cd /opt/PoshC2_Python/
git pull
echo "[+] Performing git pull on $ROOTDIR"
git pull
# Restore config
echo "[+] Restore Config.py"
mv /tmp/Config.py /opt/PoshC2_Python/Config.py
echo "[+] Restore Config"
git stash pop > /dev/null
echo ""
echo "[+] Update complete"
echo ""
popd > /dev/null