Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
NEMS Linux
committed
Apr 21, 2021
1 parent
a0c6062
commit 392fe24
Showing
8 changed files
with
37 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,2 @@ | ||
#!/bin/bash | ||
|
||
# Web Interface | ||
cd /var/www | ||
|
||
git clone https://github.com/Cat5TV/nems-www | ||
|
||
useradd www-data | ||
chown -R www-data:www-data nems-www | ||
|
||
# Detect if the snapshot folder is mounted (which means this is Docker) | ||
if [[ -e /var/www/html/backup/snapshot/ ]]; then | ||
# Docker, so rsync instead of replace | ||
apt-get update | ||
apt-get install -y rsync | ||
rsync -a nems-www/. html/ | ||
rm -rf nems-www | ||
# Remove the Apache placeholder | ||
if [[ -e /var/www/html/index.html ]]; then | ||
rm -f /var/www/html/index.html | ||
fi | ||
else | ||
# All other platforms (not Docker) | ||
if [[ -d html ]]; then | ||
rm -rf html | ||
fi | ||
mv nems-www html | ||
fi | ||
|
||
# NEMS-SST will need access to a few things | ||
if ! grep -q "# nems-www" /etc/sudoers; then | ||
echo ' | ||
# nems-www' | sudo EDITOR='tee -a' visudo | ||
fi | ||
|
||
if ! grep -q "www-data ALL=NOPASSWD: /usr/bin/htpasswd" /etc/sudoers; then | ||
echo 'www-data ALL=NOPASSWD: /usr/bin/htpasswd' | sudo EDITOR='tee -a' visudo | ||
fi | ||
|
||
if [[ -e /sbin/reboot ]]; then | ||
if ! grep -q "www-data ALL=NOPASSWD: /sbin/reboot" /etc/sudoers; then | ||
echo 'www-data ALL=NOPASSWD: /sbin/reboot' | sudo EDITOR='tee -a' visudo | ||
fi | ||
fi | ||
|
||
if [[ -e /sbin/shutdown ]]; then | ||
if ! grep -q "www-data ALL=NOPASSWD: /sbin/shutdown" /etc/sudoers; then | ||
echo 'www-data ALL=NOPASSWD: /sbin/shutdown' | sudo EDITOR='tee -a' visudo | ||
fi | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
9590 | ||
nems-www | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,3 +52,9 @@ grub2-common | |
#firmware-linux-nonfree | ||
ssh | ||
less | ||
|
||
# NEMS Linux 1.6+ | ||
9590 | ||
nems-www | ||
wmic | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters