mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-20 06:56:18 -05:00
Moving wrolpi user creation above usage.
This commit is contained in:
parent
0a2a8c0702
commit
2f43b34b79
1 changed files with 8 additions and 8 deletions
16
repair.sh
16
repair.sh
|
|
@ -25,6 +25,14 @@ systemctl stop nginx || :
|
|||
systemctl stop renderd || :
|
||||
systemctl stop apache2 || :
|
||||
|
||||
# Create the WROLPi user
|
||||
grep wrolpi: /etc/passwd || useradd -md /home/wrolpi wrolpi -s "$(command -v bash)"
|
||||
[ -f /home/wrolpi/.pgpass ] || cat >/home/wrolpi/.pgpass <<'EOF'
|
||||
127.0.0.1:5432:gis:_renderd:wrolpi
|
||||
127.0.0.1:5432:wrolpi:wrolpi:wrolpi
|
||||
EOF
|
||||
chmod 0600 /home/wrolpi/.pgpass
|
||||
|
||||
# Reset any inadvertent changes to the WROLPi repo. Restore ownership in case this repair script fails.
|
||||
git config --global --add safe.directory /opt/wrolpi
|
||||
git reset HEAD --hard
|
||||
|
|
@ -76,14 +84,6 @@ a2enmod headers
|
|||
systemctl enable renderd
|
||||
systemctl start renderd
|
||||
|
||||
# Create the WROLPi user
|
||||
grep wrolpi: /etc/passwd || useradd -md /home/wrolpi wrolpi -s "$(command -v bash)"
|
||||
[ -f /home/wrolpi/.pgpass ] || cat >/home/wrolpi/.pgpass <<'EOF'
|
||||
127.0.0.1:5432:gis:_renderd:wrolpi
|
||||
127.0.0.1:5432:wrolpi:wrolpi:wrolpi
|
||||
EOF
|
||||
chmod 0600 /home/wrolpi/.pgpass
|
||||
|
||||
# WROLPi needs a few privileged commands.
|
||||
cp /opt/wrolpi/etc/raspberrypios/90-wrolpi /etc/sudoers.d/90-wrolpi
|
||||
chmod 0440 /etc/sudoers.d/90-wrolpi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue