36 lines
1.1 KiB
Bash
Executable File
36 lines
1.1 KiB
Bash
Executable File
#!/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 ""
|