lf-updr/lf-updrd

36 lines
739 B
Plaintext
Raw Permalink Normal View History

2024-10-27 10:38:55 +01:00
#!/bin/bash
############################################
# lf-updrd - Linux Firmware Updater Daemon #
# Author: q3aql@duck.com #
# License: GPLv2.0 #
############################################
run_wait=30 # 30s
interval=28800 # 8h
# Check if process have root permissions
mkdir -p /etc/root &> /dev/null
administrador=$?
if [ ${administrador} -eq 0 ] ; then
rm -rf /etc/root
else
echo "* Root permissions are required"
exit
fi
# Run daemon
daemon=0
if [ -f /usr/bin/lf-updr ] ; then
echo "* Starting lf-updrd daemon"
sleep ${run_wait}
while [ ${daemon} -eq 0 ] ; do
/usr/bin/lf-updr
sleep ${interval}
done
else
echo "* Error: /usr/bin/lf-updr not found"
exit 1
fi