From 9799a4709f982a95d1e982b4442b2c7752edc356 Mon Sep 17 00:00:00 2001 From: Tom <116762865+NomDeTom@users.noreply.github.com> Date: Sun, 9 Feb 2025 00:30:16 +0000 Subject: [PATCH 1/4] Add SFC alias to bash_aliases at firstrun because 14 extra characters is too much. --- .../usr/local/bin/femto-runonce.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh index 1530030..7ffb9de 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh @@ -96,8 +96,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/.bash_aliases; then # Check if the lines are already in .bash_aliases + echo "alias sfc='sudo femto-config'" >> /home/femto/.bash_aliases + echo "alias sfc='sudo femto-config' to .bash_aliases" +else + echo "alias sfc='sudo femto-config' already present in .bash_aliases, 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 \ No newline at end of file +reboot From 48f4bec53958f8ca41df1655fcb7adeb3f409de0 Mon Sep 17 00:00:00 2001 From: Tom <116762865+NomDeTom@users.noreply.github.com> Date: Sun, 9 Feb 2025 00:43:04 +0000 Subject: [PATCH 2/4] Update 00-header --- .../sysdrv/out/rootfs_uclibc_rv1106/etc/update-motd.d/00-header | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/update-motd.d/00-header b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/update-motd.d/00-header index 8d10a9d..35329a2 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/update-motd.d/00-header +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/update-motd.d/00-header @@ -15,7 +15,7 @@ fi foxbuntu_version=$(grep -oP 'major=\K[0-9]+' /etc/foxbuntu-release).$(grep -oP 'minor=\K[0-9]+' /etc/foxbuntu-release)$(output=$(grep -o 'patch=[1-9][0-9]*' /etc/foxbuntu-release | cut -d= -f2) && [ -n "$output" ] && echo ".$output")$(grep -oP 'hotfix=\K[a-z]+' /etc/foxbuntu-release) spaces=$((11 - ${#foxbuntu_version})) -printf " For settings, run \`\033[0;31msudo femto-config\033[0m\`\n" +printf " For settings, run \`\033[0;31msudo femto-config\033[0m\` or \`\033[0;31msfc\033[0m\`\n" printf " Made for Femtofox https://www.femtofox.com\n" printf " Foxbuntu v$foxbuntu_version%*s%s(%s)\n\n" $spaces "" "$DISTRIB_DESCRIPTION" "$(uname -r)" From 4926254b4064f434db891def8b1cc41bc34fd07a Mon Sep 17 00:00:00 2001 From: Tom <116762865+NomDeTom@users.noreply.github.com> Date: Mon, 10 Feb 2025 18:28:42 +0000 Subject: [PATCH 3/4] Revert 00-header --- .../sysdrv/out/rootfs_uclibc_rv1106/etc/update-motd.d/00-header | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/update-motd.d/00-header b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/update-motd.d/00-header index 35329a2..8d10a9d 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/update-motd.d/00-header +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/update-motd.d/00-header @@ -15,7 +15,7 @@ fi foxbuntu_version=$(grep -oP 'major=\K[0-9]+' /etc/foxbuntu-release).$(grep -oP 'minor=\K[0-9]+' /etc/foxbuntu-release)$(output=$(grep -o 'patch=[1-9][0-9]*' /etc/foxbuntu-release | cut -d= -f2) && [ -n "$output" ] && echo ".$output")$(grep -oP 'hotfix=\K[a-z]+' /etc/foxbuntu-release) spaces=$((11 - ${#foxbuntu_version})) -printf " For settings, run \`\033[0;31msudo femto-config\033[0m\` or \`\033[0;31msfc\033[0m\`\n" +printf " For settings, run \`\033[0;31msudo femto-config\033[0m\`\n" printf " Made for Femtofox https://www.femtofox.com\n" printf " Foxbuntu v$foxbuntu_version%*s%s(%s)\n\n" $spaces "" "$DISTRIB_DESCRIPTION" "$(uname -r)" From 5d1518bd911076d61a9f60fd39b1a545bd10f6fc Mon Sep 17 00:00:00 2001 From: noon92 <40807970+noon92@users.noreply.github.com> Date: Mon, 10 Feb 2025 20:39:18 +0200 Subject: [PATCH 4/4] Update femto-runonce.sh --- .../usr/local/bin/femto-runonce.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh index 7ffb9de..9776b6c 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh @@ -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 @@ -97,11 +98,11 @@ else fi # Add a cheeky alias to .bash_aliases -if ! grep -Fxq "alias sfc='sudo femto-config'" /home/femto/.bash_aliases; then # Check if the lines are already in .bash_aliases - echo "alias sfc='sudo femto-config'" >> /home/femto/.bash_aliases - echo "alias sfc='sudo femto-config' 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 .bash_aliases, skipping" + echo "alias sfc='sudo femto-config' already present in .bashrc, skipping" fi # remove first boot flag