Skip to content

Commit a118681

Browse files
author
mkyla
authored
Change default TLS option to 1 and update API key retrieval
1 parent 47e8aea commit a118681

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

np.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ install() {
3838
printf "Listen address [0.0.0.0]: "; read -r addr; addr=${addr:-0.0.0.0}
3939
printf "Listen port [1024]: "; read -r port; port=${port:-1024}
4040
printf "API prefix (optional): "; read -r pfx
41-
printf "TLS (0=none 1=self-signed 2=custom) [0]: "; read -r tls; tls=${tls:-0}
41+
printf "TLS (0=none 1=self-signed 2=custom) [1]: "; read -r tls; tls=${tls:-1}
4242
q="tls=$tls"
4343
[ "$tls" = "2" ] && {
4444
printf "Cert path: "; read -r crt
@@ -50,7 +50,7 @@ install() {
5050
dl && svc && systemctl start nodepass
5151
sleep 1
5252
s=http; [ "$tls" != "0" ] && s=https
53-
k=$(journalctl -u nodepass -n 50 --no-pager 2>/dev/null | grep -oE 'API Key.*[0-9a-f-]{36}' | grep -oE '[0-9a-f-]{36}' | tail -1)
53+
k=$(journalctl -u nodepass -n 50 --no-pager 2>/dev/null | grep "API Key created:" | tail -1 | grep -oE '[0-9a-f]{32}')
5454
echo "=== NodePass Installed ==="
5555
echo "URL: $s://$addr:$port$pfx/v1"
5656
[ -n "$k" ] && echo "Key: $k"

0 commit comments

Comments
 (0)