mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
Online history work 👷
This commit is contained in:
@@ -7,15 +7,15 @@ echo "---------------------------------------------------------"
|
||||
|
||||
INSTALL_DIR=/home/pi # Specify the installation directory here
|
||||
|
||||
# # if custom variables not set we do not need to do anything
|
||||
# if [ -n "${TZ}" ]; then
|
||||
# FILECONF=$INSTALL_DIR/pialert/config/pialert.conf
|
||||
# if [ -f "$FILECONF" ]; then
|
||||
# sed -ie "s|Europe/Berlin|${TZ}|g" $INSTALL_DIR/pialert/config/pialert.conf
|
||||
# else
|
||||
# sed -ie "s|Europe/Berlin|${TZ}|g" $INSTALL_DIR/pialert/back/pialert.conf_bak
|
||||
# fi
|
||||
# fi
|
||||
# if custom variables not set we do not need to do anything
|
||||
if [ -n "${TZ}" ]; then
|
||||
FILECONF=$INSTALL_DIR/pialert/config/pialert.conf
|
||||
if [ -f "$FILECONF" ]; then
|
||||
sed -ie "s|Europe/Berlin|${TZ}|g" $INSTALL_DIR/pialert/config/pialert.conf
|
||||
else
|
||||
sed -ie "s|Europe/Berlin|${TZ}|g" $INSTALL_DIR/pialert/back/pialert.conf_bak
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check if script is run as root
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
|
||||
@@ -26,9 +26,10 @@ array=( ${LINE//:/ } )
|
||||
USER_HOME=${array[4]}
|
||||
|
||||
# print debug output
|
||||
echo USER_ID: ${USER_ID};
|
||||
echo USER_GID: ${USER_GID};
|
||||
echo USER_ID : ${USER_ID};
|
||||
echo USER_GID : ${USER_GID};
|
||||
echo USER_HOME: ${USER_HOME};
|
||||
echo TZ : ${TZ};
|
||||
|
||||
sed -i -e "s/^${USER}:\([^:]*\):[0-9]*:[0-9]*/${USER}:\1:${USER_ID}:${USER_GID}/" /etc/passwd
|
||||
sed -i -e "s/^${USER}:\([^:]*\):[0-9]*/${USER}:\1:${USER_GID}/" /etc/group
|
||||
|
||||
Reference in New Issue
Block a user