fix port increment issue (#88)
This commit is contained in:
@@ -511,14 +511,13 @@ add_camera() {
|
|||||||
read CAMPORT
|
read CAMPORT
|
||||||
if [ -z "$CAMPORT" ]; then
|
if [ -z "$CAMPORT" ]; then
|
||||||
CAMPORT=$(tail -1 /etc/camera_ports)
|
CAMPORT=$(tail -1 /etc/camera_ports)
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$CAMPORT" ]; then
|
if [ -z "$CAMPORT" ]; then
|
||||||
CAMPORT=8000
|
CAMPORT=8000
|
||||||
|
fi
|
||||||
|
CAMPORT=$((CAMPORT+1))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CAMPORT=$((CAMPORT+1))
|
|
||||||
|
|
||||||
if [ $CAMPORT -gt 7000 ]; then
|
if [ $CAMPORT -gt 7000 ]; then
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
@@ -976,33 +975,33 @@ firstrun() {
|
|||||||
echo
|
echo
|
||||||
if prompt_confirm "Do you want to setup your admin user now?"; then
|
if prompt_confirm "Do you want to setup your admin user now?"; then
|
||||||
while true; do
|
while true; do
|
||||||
echo 'Enter admin user name (no spaces): '
|
echo 'Enter admin user name (no spaces): '
|
||||||
read OCTOADMIN
|
read OCTOADMIN
|
||||||
if [ -z "$OCTOADMIN" ]; then
|
if [ -z "$OCTOADMIN" ]; then
|
||||||
echo -e "No admin user given! Defaulting to: \033[0;31moctoadmin\033[0m"
|
echo -e "No admin user given! Defaulting to: \033[0;31moctoadmin\033[0m"
|
||||||
OCTOADMIN=octoadmin
|
OCTOADMIN=octoadmin
|
||||||
fi
|
fi
|
||||||
if ! has-space "$OCTOADMIN"; then
|
if ! has-space "$OCTOADMIN"; then
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
echo "Admin user name must not have spaces."
|
echo "Admin user name must not have spaces."
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo "Admin user: $OCTOADMIN"
|
echo "Admin user: $OCTOADMIN"
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
echo 'Enter admin user password (no spaces): '
|
echo 'Enter admin user password (no spaces): '
|
||||||
read OCTOPASS
|
read OCTOPASS
|
||||||
if [ -z "$OCTOPASS" ]; then
|
if [ -z "$OCTOPASS" ]; then
|
||||||
echo -e "No password given! Defaulting to: \033[0;31mfooselrulz\033[0m. Please CHANGE this."
|
echo -e "No password given! Defaulting to: \033[0;31mfooselrulz\033[0m. Please CHANGE this."
|
||||||
OCTOPASS=fooselrulz
|
OCTOPASS=fooselrulz
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! has-space "$OCTOPASS"; then
|
if ! has-space "$OCTOPASS"; then
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
echo "Admin password cannot contain spaces"
|
echo "Admin password cannot contain spaces"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
done
|
done
|
||||||
echo "Admin password: $OCTOPASS"
|
echo "Admin password: $OCTOPASS"
|
||||||
|
|||||||
Reference in New Issue
Block a user