Skip to content

Instantly share code, notes, and snippets.

@brahimmachkouri
Last active October 31, 2024 09:45
Show Gist options
  • Select an option

  • Save brahimmachkouri/216301eb5e9b1a86d8b43f57443159f6 to your computer and use it in GitHub Desktop.

Select an option

Save brahimmachkouri/216301eb5e9b1a86d8b43f57443159f6 to your computer and use it in GitHub Desktop.
Uninstall Ajenti
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
DISTRO=
OS=
if grep 'Debian' /etc/issue > /dev/null 2>&1 ; then
OS=debian
DISTRO=debian
fi
if grep 'Ubuntu' /etc/issue > /dev/null 2>&1 ; then
OS=debian
DISTRO=ubuntu
fi
if grep 'ubuntu' /etc/os-release > /dev/null 2>&1 ; then
OS=debian
DISTRO=ubuntu
fi
echo ":: OS: $OS"
echo ":: Distro: $DISTRO"
/etc/init.d/ajenti stop
systemctl stop ajenti
echo ":: Uninstalling Ajenti"
/usr/bin/yes | `which pip` uninstall ajenti-panel ajenti.plugin.dashboard ajenti.plugin.settings ajenti.plugin.plugins ajenti.plugin.notepad ajenti.plugin.terminal ajenti.plugin.filemanager ajenti.plugin.packages ajenti.plugin.services || exit 1
# ----------------
echo ":: Uninstalling initscript"
if [ -f /etc/init/ajenti.conf ] ; then
rm /etc/init/ajenti.conf /lib/systemd/system/ajenti.service /etc/init.d/ajenti /var/run/ajenti.pid 2>/dev/null
rm -fr /etc/ajenti /var/log/ajenti /sys/fs/cgroup/pids/system.slice/ajenti.service /sys/fs/cgroup/devices/system.slice/ajenti.service /sys/fs/cgroup/systemd/system.slice/ajenti.service 2>/dev/null
fi
echo ':: Ajenti Uninstalled.'
@ohkeenan

ohkeenan commented Jul 6, 2018

Copy link
Copy Markdown

Thanks for this!

@PWNYYY

PWNYYY commented Mar 9, 2019

Copy link
Copy Markdown

Kuss

@maoyuching

Copy link
Copy Markdown

great!!

@rajanverma-me

Copy link
Copy Markdown

If someone has installed using automatic installer. use below

pip uninstall ajenti-panel ajenti.plugin.dashboard ajenti.plugin.settings ajenti.plugin.plugins ajenti.plugin.notepad ajenti.plugin.terminal ajenti.plugin.filemanager ajenti.plugin.packages ajenti.plugin.services

@Slyai

Slyai commented Mar 21, 2021

Copy link
Copy Markdown

thanks

@mohammadtz

mohammadtz commented Oct 27, 2021

Copy link
Copy Markdown

very useful, Thanks

@AtomRun-Code

AtomRun-Code commented Mar 20, 2022

Copy link
Copy Markdown

Star!Thx~

@jansanc

jansanc commented Aug 2, 2022

Copy link
Copy Markdown

Really appreciate! Thanks!

@atarwn

atarwn commented Sep 22, 2024

Copy link
Copy Markdown

<3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment