Merge branch 'master' into add_pl_locales
This commit is contained in:
commit
3da99d826e
27
install.sh
27
install.sh
@ -7,11 +7,11 @@ LOCALES=(de en es fr it pl pt ru)
|
|||||||
|
|
||||||
welcome_screen() {
|
welcome_screen() {
|
||||||
cat << "EOF"
|
cat << "EOF"
|
||||||
__ _ __ _ _
|
__ _ __ _ _
|
||||||
(_ |_) \_/ /__ | | /\ |_) | \
|
(_ |_) \_/ /__ | | /\ |_) | \
|
||||||
__) | | \_| |_| /--\ | \ |_/
|
__) | | \_| |_| /--\ | \ |_/
|
||||||
|
|
||||||
SpyGuard is a fork of TinyCheck, developped by Kaspersky.
|
SpyGuard is a fork of TinyCheck, developped by Kaspersky.
|
||||||
-----
|
-----
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
@ -66,8 +66,8 @@ set_credentials() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
create_directory() {
|
create_directory() {
|
||||||
# Create the Spyguard directory and move the whole stuff there.
|
# Create the SpyGuard directory and move the whole stuff there.
|
||||||
echo -e "[+] Creating Spyguard folder under /usr/share/"
|
echo -e "[+] Creating SpyGuard folder under /usr/share/"
|
||||||
mkdir /usr/share/spyguard
|
mkdir /usr/share/spyguard
|
||||||
cp -Rf ./* /usr/share/spyguard
|
cp -Rf ./* /usr/share/spyguard
|
||||||
}
|
}
|
||||||
@ -90,7 +90,7 @@ Description=Spyguard frontend service
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
ExecStart=/usr/bin/python3 /usr/share/spyguard/server/frontend/main.py
|
ExecStart=/usr/share/spyguard/spyguard-venv/bin/python3 /usr/share/spyguard/server/frontend/main.py
|
||||||
Restart=on-abort
|
Restart=on-abort
|
||||||
KillMode=process
|
KillMode=process
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ Description=Spyguard backend service
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
ExecStart=/usr/bin/python3 /usr/share/spyguard/server/backend/main.py
|
ExecStart=/usr/share/spyguard/spyguard-venv/bin/python3 /usr/share/spyguard/server/backend/main.py
|
||||||
Restart=on-abort
|
Restart=on-abort
|
||||||
KillMode=process
|
KillMode=process
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ After=network-online.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
ExecStart=/usr/bin/python3 /usr/share/spyguard/server/backend/watchers.py
|
ExecStart=/usr/share/spyguard/spyguard-venv/bin/python3 /usr/share/spyguard/server/backend/watchers.py
|
||||||
Restart=on-abort
|
Restart=on-abort
|
||||||
KillMode=process
|
KillMode=process
|
||||||
|
|
||||||
@ -171,7 +171,7 @@ check_dependencies() {
|
|||||||
"/usr/bin/dig"
|
"/usr/bin/dig"
|
||||||
"/usr/bin/suricata"
|
"/usr/bin/suricata"
|
||||||
"/usr/bin/sqlite3"
|
"/usr/bin/sqlite3"
|
||||||
"/usr/bin/pip3",
|
"/usr/bin/pip3"
|
||||||
"/usr/sbin/arp")
|
"/usr/sbin/arp")
|
||||||
|
|
||||||
echo -e "\e[39m[+] Checking dependencies...\e[39m"
|
echo -e "\e[39m[+] Checking dependencies...\e[39m"
|
||||||
@ -184,8 +184,11 @@ check_dependencies() {
|
|||||||
install_package ${bin##*/}
|
install_package ${bin##*/}
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
echo -e "\e[39m[+] Create and activate Virtual Environment for Python packages\e[39m"
|
||||||
|
python3 -m venv /usr/share/spyguard/spyguard-venv
|
||||||
|
source /usr/share/spyguard/spyguard-venv/bin/activate
|
||||||
echo -e "\e[39m[+] Install Python packages...\e[39m"
|
echo -e "\e[39m[+] Install Python packages...\e[39m"
|
||||||
python3 -m pip install -r "$SCRIPT_PATH/assets/requirements.txt"
|
python3 -m pip install -r "$SCRIPT_PATH/assets/requirements.txt" --no-cache-dir
|
||||||
}
|
}
|
||||||
|
|
||||||
get_version() {
|
get_version() {
|
||||||
|
17
uninstall.sh
17
uninstall.sh
@ -1,11 +1,11 @@
|
|||||||
|
|
||||||
delete_folder(){
|
delete_folder(){
|
||||||
echo "[+] Deleting Spyguard folders"
|
echo "[+] Deleting SpyGuard folders"
|
||||||
rm -rf /usr/share/spyguard/
|
rm -rf /usr/share/spyguard/
|
||||||
}
|
}
|
||||||
|
|
||||||
delete_services(){
|
delete_services(){
|
||||||
echo "[+] Deleting Spyguard services"
|
echo "[+] Deleting SpyGuard services"
|
||||||
|
|
||||||
systemctl disable spyguard-frontend &> /dev/null
|
systemctl disable spyguard-frontend &> /dev/null
|
||||||
systemctl disable spyguard-backend &> /dev/null
|
systemctl disable spyguard-backend &> /dev/null
|
||||||
@ -16,27 +16,23 @@ delete_services(){
|
|||||||
rm /lib/systemd/system/spyguard-watchers.service
|
rm /lib/systemd/system/spyguard-watchers.service
|
||||||
}
|
}
|
||||||
|
|
||||||
deleting_icon(){
|
|
||||||
echo "[+] Deleting desktop icon"
|
|
||||||
rm "/home/${SUDO_USER}/Desktop/spyguard.desktop"
|
|
||||||
}
|
|
||||||
|
|
||||||
delete_packages(){
|
delete_packages(){
|
||||||
pkgs=("tshark"
|
pkgs=("tshark"
|
||||||
"dnsutils"
|
"dnsutils"
|
||||||
"suricata"
|
"suricata"
|
||||||
"sqlite3")
|
"sqlite3")
|
||||||
|
|
||||||
echo -n "[?] Do you want to remove the installed packages? (Yes/no) "
|
echo -n "[?] Do you want to remove the installed packages? (Yes/no) "
|
||||||
read answer
|
read answer
|
||||||
if [[ "$answer" =~ ^([yY][eE][sS]|[yY])$ ]]
|
if [[ "$answer" =~ ^([yY][eE][sS]|[yY])$ ]]
|
||||||
then
|
then
|
||||||
|
rm -rf /var/log/suricata
|
||||||
for pkg in "${pkgs[@]}"
|
for pkg in "${pkgs[@]}"
|
||||||
do
|
do
|
||||||
apt -y remove $pkg && apt -y purge $pkg
|
apt -y remove $pkg && apt -y purge $pkg
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
apt autoremove &> /dev/null
|
apt autoremove &> /dev/null -y
|
||||||
}
|
}
|
||||||
|
|
||||||
update_hostname(){
|
update_hostname(){
|
||||||
@ -59,7 +55,6 @@ if [[ $EUID -ne 0 ]]; then
|
|||||||
else
|
else
|
||||||
delete_folder
|
delete_folder
|
||||||
delete_services
|
delete_services
|
||||||
deleting_icon
|
|
||||||
update_hostname
|
update_hostname
|
||||||
delete_packages
|
delete_packages
|
||||||
reboot_box
|
reboot_box
|
||||||
|
@ -6,12 +6,12 @@ fi
|
|||||||
|
|
||||||
if [ $PWD = "/usr/share/spyguard" ]; then
|
if [ $PWD = "/usr/share/spyguard" ]; then
|
||||||
echo "[+] Cloning the current repository to /tmp/"
|
echo "[+] Cloning the current repository to /tmp/"
|
||||||
rm -rf /tmp/spyguard/ &> /dev/null
|
rm -rf /tmp/spyguard/ &> /dev/null
|
||||||
cd /tmp/ && git clone https://github.com/SpyGuard/spyguard
|
cd /tmp/ && git clone https://github.com/SpyGuard/spyguard
|
||||||
cd /tmp/spyguard && bash update.sh
|
cd /tmp/spyguard && bash update.sh
|
||||||
elif [ $PWD = "/tmp/spyguard" ]; then
|
elif [ $PWD = "/tmp/spyguard" ]; then
|
||||||
|
|
||||||
echo "[+] Saving spyguard backend's SSL configuration in /tmp/"
|
echo "[+] Saving SpyGuard backend's SSL configuration in /tmp/"
|
||||||
mv /usr/share/spyguard/server/backend/*.pem /tmp/
|
mv /usr/share/spyguard/server/backend/*.pem /tmp/
|
||||||
|
|
||||||
echo "[+] Deleting the current SpyGuard folders and files."
|
echo "[+] Deleting the current SpyGuard folders and files."
|
||||||
@ -48,4 +48,4 @@ elif [ $PWD = "/tmp/spyguard" ]; then
|
|||||||
cd /tmp/spyguard && git tag | tail -n 1 | xargs echo -n > /usr/share/spyguard/VERSION
|
cd /tmp/spyguard && git tag | tail -n 1 | xargs echo -n > /usr/share/spyguard/VERSION
|
||||||
|
|
||||||
echo "[+] SpyGuard updated!"
|
echo "[+] SpyGuard updated!"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user