login trixie fix
This commit is contained in:
@@ -317,8 +317,9 @@ Description=BirdNET-Pi Web Terminal
|
|||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=3
|
RestartSec=3
|
||||||
Type=simple
|
Type=simple
|
||||||
|
User=${USER}
|
||||||
Environment=TERM=xterm-256color
|
Environment=TERM=xterm-256color
|
||||||
ExecStart=/usr/local/bin/gotty --address localhost -w -p 8888 --path terminal --title-format "BirdNET-Pi Terminal" login
|
ExecStart=/usr/local/bin/gotty --address localhost -w -p 8888 --path terminal --title-format "BirdNET-Pi Terminal" bash -c 'read -p "Login: " username && [[ "$username" =~ ^[-_.a-z0-9]{1,30}$ ]] && su --pty -l $username'
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
@@ -198,7 +198,13 @@ fi
|
|||||||
|
|
||||||
if grep -q -e '-P terminal' $HOME/BirdNET-Pi/templates/web_terminal.service ; then
|
if grep -q -e '-P terminal' $HOME/BirdNET-Pi/templates/web_terminal.service ; then
|
||||||
sed -i "s/-P terminal/--path terminal/" ~/BirdNET-Pi/templates/web_terminal.service
|
sed -i "s/-P terminal/--path terminal/" ~/BirdNET-Pi/templates/web_terminal.service
|
||||||
systemctl daemon-reload && restart_services.sh
|
systemctl daemon-reload && systemctl restart web_terminal.service
|
||||||
|
fi
|
||||||
|
|
||||||
|
if grep -q -e ' login' $HOME/BirdNET-Pi/templates/web_terminal.service ; then
|
||||||
|
sed -i "s/ login/ bash -c 'read -p \"Login: \" username \&\& [[ \"\$username\" =~ ^[-_.a-z0-9]{1,30}\$ ]] \&\& su --pty -l \$username'/" ~/BirdNET-Pi/templates/web_terminal.service
|
||||||
|
sed -i "/\[Service\]/a User=$BIRDNET_USER" ~/BirdNET-Pi/templates/web_terminal.service
|
||||||
|
systemctl daemon-reload && systemctl restart web_terminal.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if grep -q -e 'Environment=XDG_RUNTIME_DIR=/run/user/' $HOME/BirdNET-Pi/templates/birdnet_recording.service; then
|
if grep -q -e 'Environment=XDG_RUNTIME_DIR=/run/user/' $HOME/BirdNET-Pi/templates/birdnet_recording.service; then
|
||||||
|
|||||||
Reference in New Issue
Block a user