29 changed files with 134 additions and 57 deletions
@ -0,0 +1,3 @@
@@ -0,0 +1,3 @@
|
||||
{ |
||||
"shutdown-timeout": 60 |
||||
} |
||||
@ -0,0 +1,25 @@
@@ -0,0 +1,25 @@
|
||||
[Unit] |
||||
Description=Mistborn RaspAP Service |
||||
Requires=Mistborn-base.service |
||||
After=Mistborn-base.service |
||||
|
||||
[Service] |
||||
Restart=always |
||||
RestartSec=15 |
||||
User=root |
||||
Group=docker |
||||
PermissionsStartOnly=true |
||||
ExecStartPre=/sbin/iptables -I DOCKER-USER -i DIFACE -p tcp --dport 8095 -j MISTBORN_LOG_DROP |
||||
#ExecStartPre=/bin/bash /opt/mistborn_volumes/extra/raspap/etc-raspap/hostapd/servicestart.sh --interface uap0 --seconds 3 |
||||
# Shutdown container (if running) when unit is stopped |
||||
ExecStartPre=/opt/mistborn/scripts/wrappers/mistborn_docker.sh raspap docker-compose -f /opt/mistborn/extra/raspap.yml down |
||||
|
||||
# Start container when unit is started |
||||
ExecStart=/opt/mistborn/scripts/wrappers/mistborn_docker.sh raspap docker-compose -f /opt/mistborn/extra/raspap.yml up --build |
||||
# Stop container when unit is stopped |
||||
ExecStop=/opt/mistborn/scripts/wrappers/mistborn_docker.sh raspap docker-compose -f /opt/mistborn/extra/raspap.yml down |
||||
ExecStopPost=-/sbin/iptables -D DOCKER-USER -i DIFACE -p tcp --dport 8095 -j MISTBORN_LOG_DROP |
||||
# Post stop |
||||
|
||||
[Install] |
||||
WantedBy=multi-user.target |
||||
@ -1,21 +0,0 @@
@@ -1,21 +0,0 @@
|
||||
[Unit] |
||||
Description=Mistborn RaspAP Service |
||||
Requires=Mistborn-base.service |
||||
After=Mistborn-base.service |
||||
|
||||
[Service] |
||||
Restart=always |
||||
User=root |
||||
Group=docker |
||||
PermissionsStartOnly=true |
||||
# Shutdown container (if running) when unit is stopped |
||||
ExecStartPre=/usr/local/bin/docker-compose -f /opt/mistborn/extra/raspap.yml down |
||||
|
||||
# Start container when unit is started |
||||
ExecStart=/usr/local/bin/docker-compose -f /opt/mistborn/extra/raspap.yml up --build |
||||
# Stop container when unit is stopped |
||||
ExecStop=/usr/local/bin/docker-compose -f /opt/mistborn/extra/raspap.yml down |
||||
# Post stop |
||||
|
||||
[Install] |
||||
WantedBy=multi-user.target |
||||
@ -1,4 +0,0 @@
@@ -1,4 +0,0 @@
|
||||
#!/bin/bash |
||||
|
||||
# install on gateway |
||||
sudo apt-get install -y hostapd vnstat |
||||
@ -0,0 +1,7 @@
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash |
||||
|
||||
# daemon.json |
||||
if [ ! -f /etc/docker/daemon.json ]; then |
||||
sudo -E cp ./scripts/conf/docker-daemon.json /etc/docker/daemon.json |
||||
sudo -E systemctl restart docker |
||||
fi |
||||
@ -0,0 +1,6 @@
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash |
||||
|
||||
# RaspAP |
||||
RASPAP_PROD_FILE="$1" |
||||
echo "MISTBORN_DEFAULT_PASSWORD=$MISTBORN_DEFAULT_PASSWORD" > $RASPAP_PROD_FILE |
||||
chmod 600 $RASPAP_PROD_FILE |
||||
@ -0,0 +1,22 @@
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash |
||||
|
||||
# INPUT default admin password |
||||
while [ -z "${MISTBORN_DEFAULT_PASSWORD}" ]; do |
||||
echo |
||||
echo "(Mistborn) The default admin password may only container alphanumeric characters and _" |
||||
read -p "(Mistborn) Set default admin password: " -s MISTBORN_DEFAULT_PASSWORD |
||||
echo |
||||
|
||||
if [[ ${MISTBORN_DEFAULT_PASSWORD} =~ ^[A-Za-z0-9_]+$ ]]; then |
||||
# it matches |
||||
echo "(Mistborn) Password is accepted" |
||||
else |
||||
unset MISTBORN_DEFAULT_PASSWORD |
||||
echo "(Mistborn) Try again" |
||||
fi |
||||
|
||||
done |
||||
|
||||
echo |
||||
echo "MISTBORN_DEFAULT_PASSWORD is set" |
||||
echo |
||||
Loading…
Reference in new issue