@@ -691,23 +691,31 @@ function setupWiredNetworking() {
691691 echo " WARNING: If you continue, the IP address of your Pi may change upon reboot."
692692 echo " Please make sure you will not lose access to the Pi system."
693693 echo " "
694- echo " Do you want to proceed with network configuration using the default settings? [Y/n]"
695- read REPLY
696694
697- if [ " $REPLY " == " N" ] || [ " $REPLY " == " n" ]; then
698- echo " Available wired interfaces on this system:"
699- echo ` ip -o addr show scope link | awk ' {split($0, a); print $2}' | grep eth`
700- echo " Please type the wired interface you want to use and press Enter:"
701- read SELECTED
702- LAN_INTERFACE=$SELECTED
695+ if [[ -z $HEADLESS ]]; then
696+ echo " Do you want to proceed with network configuration using the default settings? [Y/n]"
697+ read REPLY
698+
699+ if [ " $REPLY " == " N" ] || [ " $REPLY " == " n" ]; then
700+ echo " Available wired interfaces on this system:"
701+ echo ` ip -o addr show scope link | awk ' {split($0, a); print $2}' | grep eth`
702+ echo " Please type the wired interface you want to use and press Enter:"
703+ read SELECTED
704+ LAN_INTERFACE=$SELECTED
705+ fi
703706 fi
704707
705708 if [ " $( grep -c " ^denyinterfaces" /etc/dhcpcd.conf) " -ge 1 ]; then
706709 echo " WARNING: Network forwarding may already have been configured. Proceeding will overwrite the configuration."
707- echo " Press enter to continue or CTRL-C to exit"
708- read REPLY
710+
711+ if [[ -z $HEADLESS ]]; then
712+ echo " Press enter to continue or CTRL-C to exit"
713+ read REPLY
714+ fi
715+
709716 sudo sed -i /^denyinterfaces/d /etc/dhcpcd.conf
710717 fi
718+
711719 sudo bash -c ' echo "denyinterfaces ' $LAN_INTERFACE ' " >> /etc/dhcpcd.conf'
712720 echo " Modified /etc/dhcpcd.conf"
713721
@@ -720,6 +728,12 @@ function setupWiredNetworking() {
720728 echo " Either use the Web UI, or do this on the command line (assuming SCSI ID 6):"
721729 echo " rasctl -i 6 -c attach -t scdp -f $LAN_INTERFACE "
722730 echo " "
731+
732+ if [[ $HEADLESS ]]; then
733+ echo " Skipping reboot in headless mode"
734+ return 0
735+ fi
736+
723737 echo " We need to reboot your Pi"
724738 echo " Press Enter to reboot or CTRL-C to exit"
725739 read
@@ -1269,6 +1283,7 @@ function runChoice() {
12691283 preparePythonCommon
12701284 cachePipPackages
12711285 installRaScsiWebInterface
1286+ enableWebInterfaceAuth
12721287 echo " Configuring RaSCSI Web Interface stand-alone - Complete!"
12731288 echo " Launch the Web Interface with the 'start.sh' script. To use a custom port for the web server: 'start.sh --web-port=8081"
12741289 ;;
@@ -1367,6 +1382,9 @@ while [ "$1" != "" ]; do
13671382 -s | --skip-token)
13681383 SKIP_TOKEN=1
13691384 ;;
1385+ -h | --headless)
1386+ HEADLESS=1
1387+ ;;
13701388 * )
13711389 echo " ERROR: Unknown parameter \" $PARAM \" "
13721390 exit 1
0 commit comments