Merge pull request #302 from femtofox/sfc-alias

Add SFC alias to bash_aliases at firstrun
This commit is contained in:
noon92 2025-02-10 22:44:23 +02:00 • committed by GitHub
commit 96060c8804
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -19,13 +19,14 @@ Re-running this script will:\n\
* Allocate the swap file\n\
* Replace the SSH encryption keys\n\
* Add terminal type to user femto's .bashrc\n\
* Add a shortcut \`sfc\` to femto's .bashrc\n\
* Set the eth0 MAC to be derivative of CPU serial number\n\
\n\
Finally, the Femtofox will reboot.\n\
\n\
Re-running this script after first boot should not cause any harm, but may not work as expected.\n\
\n\
Proceed?" 19 60
Proceed?" 20 60
if [ $? -eq 1 ]; then #if cancel/no
exit 0
fi
@ -96,8 +97,16 @@ else
echo "TERM, LANG and NCURSES_NO_UTF8_ACS already present in .bashrc, skipping"
fi
# Add a cheeky alias to .bash_aliases
if ! grep -Fxq "alias sfc='sudo femto-config'" /home/femto/.bashrc; then # Check if the lines are already in .bash_aliases
echo "alias sfc='sudo femto-config'" >> /home/femto/.bashrc
echo "Added alias sfc='sudo femto-config' to .bashrc"
else
echo "alias sfc='sudo femto-config' already present in .bashrc, skipping"
fi
# remove first boot flag
sed -i -E 's/^first_boot=.*/first_boot=false/' /etc/femto.conf
log_message "Removing first boot flag and rebooting in 5 seconds..."
sleep 5
reboot
reboot