Remove user account

This commit is contained in:
bashrc committed 2020-06-19 14:01:18 +01:00
1 parent a58efc6e0a
commit bc0089f61e
2 files changed
+14 -12

No files matched your search

+7 -6
View File
@@ -15,8 +15,8 @@ if [[ "$1" == 'remove' ]]; then
rm /var/lib/i2pd/epicyon.dat
systemctl restart i2pd
systemctl stop "${username}"
systemctl disable "${username}"
systemctl stop "${username}.service"
systemctl disable "${username}.service"
rm "/etc/nginx/sites-enabled/${username}"
rm "/etc/nginx/sites-availale/${username}"
rm -rf ${install_destination}
@@ -26,6 +26,7 @@ if [[ "$1" == 'remove' ]]; then
if [ -d /srv/http/cache ]; then
rm -rf /srv/http/cache
fi
userdel -r ${username}
echo 'Epicyon i2p instance removed'
exit 0
fi
@@ -80,8 +81,8 @@ fi
echo 'Adding an epicyon system user account'
if [ -f /usr/bin/pacman ]; then
groupadd epicyon
useradd --system -g epicyon --home-dir=${install_destination} $username
groupadd ${username}
useradd --system -g ${username} --home-dir=${install_destination} $username
groupadd www-data
useradd --system -g www-data --home-dir=/srv/http www-data
else
@@ -214,8 +215,8 @@ echo 'Creating Epicyon daemon'
echo 'WantedBy=multi-user.target'; } > "/etc/systemd/system/${username}.service"
systemctl daemon-reload
systemctl enable "/etc/systemd/system/${username}.service"
systemctl restart "/etc/systemd/system/${username}.service"
systemctl enable "${username}.service"
systemctl restart "${username}.service"
echo 'Creating nginx configuration'
if [ ! -f /etc/nginx/nginx.conf ]; then