Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firstlogin: run provision script if it does exists #7696

Merged
merged 1 commit into from
Jan 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion packages/bsp/common/usr/lib/armbian/armbian-firstlogin
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ do_firstrun_automated_network_configuration()
# - Ethernet enable
elif [[ $PRESET_NET_ETHERNET_ENABLED == 1 ]]; then

# remove dhcp config
rm -f /etc/netplan/10-dhcp-all-interfaces.yaml

DEVICE_NAME=${eth_index}
DEVTYPE=ethernets
echo -e "$(createYAML)" > /etc/netplan/30-${DEVTYPE}${CONFIG_NAME}.yaml
Expand Down Expand Up @@ -607,7 +610,6 @@ add_user() {
echo -e "\nDear \e[0;92m${RealName}\x1B[0m, your account \e[0;92m${RealUserName}\x1B[0m has been created and is sudo enabled."
echo -e "Please use this account for your daily work from now on.\n"
rm -f /root/.not_logged_in_yet
chmod +x /etc/update-motd.d/*
# set up profile sync daemon on desktop systems
if command -v psd > /dev/null 2>&1; then
echo -e "${RealUserName} ALL=(ALL) NOPASSWD: /usr/bin/psd-overlay-helper" >> /etc/sudoers
Expand Down Expand Up @@ -706,6 +708,9 @@ if [[ -f /root/.not_logged_in_yet && -n $(tty) ]]; then
loginfrom=$(who am i | awk '{print $2}')
who -la | grep root | grep -v "$loginfrom" | awk '{print $7}' | xargs --no-run-if-empty kill -9

# enable motd
chmod +x /etc/update-motd.d/*

first_input="$password"
if [ -z "$PRESET_ROOT_PASSWORD" ];then
echo ""
Expand Down Expand Up @@ -932,5 +937,11 @@ if [[ -f /root/.not_logged_in_yet && -n $(tty) ]]; then
printf "\n\n\e[0;91mWarning: a reboot is needed to finish resizing the filesystem \x1B[0m \n"
printf "\e[0;91mPlease reboot the system now \x1B[0m \n\n"
fi

fi
fi

# Run provisioning script if exists
if [[ -f /root/provisioning.sh ]]; then
. /root/provisioning.sh
fi