mirror of https://schlomp.space/tastytea/hashboot
fallback cfg when non interactive
parent
46c4c77bbe
commit
ec48450ac3
9
hashboot
9
hashboot
|
@ -70,6 +70,14 @@ then
|
||||||
[ $? != 0 ] && die 9 "Error reading config file"
|
[ $? != 0 ] && die 9 "Error reading config file"
|
||||||
#If not found, create one and ask for ${MBR_DEVICE}
|
#If not found, create one and ask for ${MBR_DEVICE}
|
||||||
else
|
else
|
||||||
|
if [ -z "$PS1" ]
|
||||||
|
then
|
||||||
|
echo "#Device with the MBR on it" > ${CONFIG_FILE}
|
||||||
|
MBR_DEVICE="/dev/sda"
|
||||||
|
echo "MBR_DEVICE=${MBR_DEVICE}" >> ${CONFIG_FILE}
|
||||||
|
else
|
||||||
|
echo "#Where the Backup files are stored" >> ${CONFIG_FILE}
|
||||||
|
echo "MBR_DEVICE=${MBR_DEVICE}" >> ${CONFIG_FILE}
|
||||||
echo -n "Which device contains the MBR? [/dev/sda] "
|
echo -n "Which device contains the MBR? [/dev/sda] "
|
||||||
read -r MBR_DEVICE
|
read -r MBR_DEVICE
|
||||||
[ -z "${MBR_DEVICE}" ] && MBR_DEVICE="/dev/sda"
|
[ -z "${MBR_DEVICE}" ] && MBR_DEVICE="/dev/sda"
|
||||||
|
@ -81,6 +89,7 @@ else
|
||||||
[ -z "${BACKUP_FILE}" ] && BACKUP_FILE="/var/cache/boot-backup.tar.gz"
|
[ -z "${BACKUP_FILE}" ] && BACKUP_FILE="/var/cache/boot-backup.tar.gz"
|
||||||
echo "#Where the Backup files are stored" >> ${CONFIG_FILE}
|
echo "#Where the Backup files are stored" >> ${CONFIG_FILE}
|
||||||
echo "BACKUP_FILE=${BACKUP_FILE}" >> ${CONFIG_FILE}
|
echo "BACKUP_FILE=${BACKUP_FILE}" >> ${CONFIG_FILE}
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Find out where the first partition starts and set ${MBR_SIZE} in KiB
|
# Find out where the first partition starts and set ${MBR_SIZE} in KiB
|
||||||
|
|
Loading…
Reference in New Issue