Installer & Unninstaller
This commit is contained in:
parent
8c3642adcd
commit
c252ed0c28
35
install.sh
Executable file
35
install.sh
Executable file
|
@ -0,0 +1,35 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Check if process have root permissions
|
||||
mkdir -p /etc/root &> /dev/null
|
||||
administrador=$?
|
||||
if [ ${administrador} -eq 0 ] ; then
|
||||
rm -rf /etc/root
|
||||
else
|
||||
echo "blockauth: root permissions are required"
|
||||
exit
|
||||
fi
|
||||
echo ""
|
||||
echo "blockauth: installation"
|
||||
echo ""
|
||||
echo "blockauth: installing file /usr/bin/blockauth"
|
||||
cp -rf blockauth /usr/bin
|
||||
chmod +x /usr/bin/blockauth
|
||||
echo "blockauth: installing file /etc/systemd/system/blockauth.service"
|
||||
cp -rf systemd/blockauth.service /etc/systemd/system/blockauth.service
|
||||
if [ -f /etc/blockauth/blockauth.conf ] ; then
|
||||
echo "blockauth: preserving existing file /etc/blockauth/blockauth.conf"
|
||||
else
|
||||
echo "blockauth: installing file /etc/blockauth/blockauth.conf"
|
||||
mkdir -p /etc/blockauth
|
||||
cp -rfv config/blockauth.conf /etc/blockauth/blockauth.conf
|
||||
fi
|
||||
echo "blockauth: reloading systemd"
|
||||
systemctl daemon-reload
|
||||
echo "blockauth: finished"
|
||||
echo ""
|
||||
echo "Note: First configure the file /etc/blockauth/blockauth.conf"
|
||||
echo "Note: After, run service:"
|
||||
echo " systemctl enable blockauth.service"
|
||||
echo " systemctl start blockauth.service"
|
||||
echo ""
|
23
unninstall.sh
Executable file
23
unninstall.sh
Executable file
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Check if process have root permissions
|
||||
mkdir -p /etc/root &> /dev/null
|
||||
administrador=$?
|
||||
if [ ${administrador} -eq 0 ] ; then
|
||||
rm -rf /etc/root
|
||||
else
|
||||
echo "blockauth: root permissions are required"
|
||||
exit
|
||||
fi
|
||||
echo ""
|
||||
echo "blockauth: unninstallation"
|
||||
echo ""
|
||||
echo "blockauth: removing file /usr/bin/blockauth"
|
||||
rm -rf /usr/bin/blockauth
|
||||
echo "blockauth: removing file /etc/systemd/system/blockauth.service"
|
||||
rm -rf /etc/systemd/system/blockauth.service
|
||||
echo "blockauth: removing configuration folder /etc/blockauth"
|
||||
rm -rf /etc/blockauth
|
||||
echo "blockauth: reloading systemd"
|
||||
systemctl daemon-reload
|
||||
echo "blockauth: finished"
|
Loading…
Reference in New Issue
Block a user