0
0
mirror of https://github.com/openwrt/packages.git synced 2025-03-15 10:18:37 +00:00
Nick Hainke 69c81790d1 wg-installer: rework code
Use shellcheck to rework the code. Use "export" to return variables from
a function call. Further, fix typos.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2022-01-20 02:04:50 +01:00

23 lines
543 B
Bash

#!/bin/sh
# do not override already existing user!!!
uci show rpcd | grep -q wginstaller && exit 0
# install wginstaller user with standard credentials
# user: wginstaller
# password: wginstaller
uci add rpcd login
uci set rpcd.@login[-1].username='wginstaller'
password=$(uhttpd -m wginstaller)
uci set rpcd.@login[-1].password="$password"
uci add_list rpcd.@login[-1].read='wginstaller'
uci add_list rpcd.@login[-1].write='wginstaller'
uci commit rpcd
# restart rpcd
/etc/init.d/rpcd restart
# restart uhttpd
/etc/init.d/uhttpd restart