Skip to content

Commit

Permalink
Slight config change to more smoothly integrate with eachother.
Browse files Browse the repository at this point in the history
  • Loading branch information
DaanSelen committed Dec 24, 2024
1 parent 21f675d commit 7f0d0e5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
31 changes: 15 additions & 16 deletions ntos/configs/minimal/finish.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

current_user=$(whoami)
# User-username: user

#########################################
# USER #
Expand All @@ -18,21 +18,21 @@ read -r new_hostname
echo -e '\nCustomizing user environment...'

echo "Grabbing ${rdp_name}.rdp from NTOS server."
curl -s "$web_address"/rdp/"${rdp_name}".rdp > /home/"${current_user}"/Templates/remote-connection.rdp
curl -s "$web_address"/rdp/"${rdp_name}".rdp > /home/user/Templates/remote-connection.rdp

echo "Grabbing Credcon from NTOS server."
curl -s "$web_address"/credcon/credcon.sh > /home/"${current_user}"/Templates/credcon.sh
curl -s "$web_address"/credcon/credcon.sh > /home/user/Templates/credcon.sh

# Download the file to /home/${currentUser}/Templates (runs as the normal user)
# Download the file to /home/user/Templates (runs as the normal user)
echo "Grabbing panel profile from NTOS server."
wget -q "${web_address}"/assets/panel-profile.tar.bz2 -P /home/"${current_user}"/Templates
wget -q "${web_address}"/assets/panel-profile.tar.bz2 -P /home/user/Templates

echo "Applying panel profile..."
xfce4-panel-profiles load /home/"${current_user}"/Templates/panel-profile.tar.bz2
xfce4-panel-profiles load /home/user/Templates/panel-profile.tar.bz2

# Just in case, set the correct user in the desktop shortcut launcher.
launcher_file=$(grep -rl 'Credcon' /home/user/.config/xfce4/panel/launcher-*)
sed -i "s|/home/dummy_user/|/home/${current_user}/|" "$launcher_file"
sed -i "s|/home/dummy_user/|/home/user/|" "$launcher_file"

# Set theme to Adwaita-Dark.
xfconf-query -c xsettings -p '/Net/ThemeName' -s 'Adwaita-dark'
Expand Down Expand Up @@ -76,8 +76,7 @@ echo -e '\nEscalating for remote management agent installation...'

# Use su to switch to root and run commands interactively
su -c "
# Start agent installation for remote management. (e.g. MeshCentral, NinjaRMM, ConnectWise RMM, etc...)
# Start agent installation for remote management. (e.g. MeshCentral, NinjaRMM, ConnectWise RMM, N-Able, etc...)
# End agent installation for remote management.
Expand All @@ -88,25 +87,25 @@ sed -i 's/^127\.0\.1\.1.*/127.0.1.1 $new_hostname/' /etc/hosts &&
# Check if the source file exists before copying
sleep 3s # Add some sleep for the machine to process everything.
if [ -f '/home/${current_user}/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml' ]; then
if [ -f '/home/user/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml' ]; then
echo 'Source xfce4-panel.xml found. Proceeding with copy.'
# Copy xfce4-panel.xml to the system-wide config directory
cp /home/${current_user}/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/ &&
cp /home/user/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/ &&
echo 'Successfully copied xfce4-panel.xml to /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/' &&
# Lock the panel configuration
sed -i 's|<channel name=\"xfce4-panel\" version=\"1.0\">|<channel name=\"xfce4-panel\" version=\"1.0\" locked=\"*\" unlocked=\"root\">|' /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml &&
echo 'Successfully applied the lock to xfce4-panel.xml'
else
echo 'Error: Source xfce4-panel.xml not found at /home/$current_user/.config/xfce4/xfconfxfce-perchannel-xml/xfce4-panel.xml'
echo 'Error: Source xfce4-panel.xml not found at /home/user/.config/xfce4/xfconfxfce-perchannel-xml/xfce4-panel.xml'
fi
mkdir -p /home/$current_user/.config/autostart
cp /etc/xdg/autostart/light-locker.desktop /home/$current_user/.config/autostart
echo 'Hidden=true' >> /home/$current_user/.config/autostart/light-locker.desktop
mkdir -p /home/user/.config/autostart
cp /etc/xdg/autostart/light-locker.desktop /home/user/.config/autostart
echo 'Hidden=true' >> /home/user/.config/autostart/light-locker.desktop
echo -e '\nPending reboot, press any key to reboot.'
read doReboot
/sbin/reboot now
"
"
2 changes: 1 addition & 1 deletion ntos/configs/minimal/preseed.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ d-i netcfg/link_wait_timeout string 2
d-i netcfg/get_domain string local

# this line can be commented out if you do not want to preset the DNS servers
d-i netcfg/get_nameservers string 9.9.9.9 1.1.1.1
d-i netcfg/get_nameservers string 9.9.9.9 8.8.8.8

# mirror settings
d-i mirror/country string NL
Expand Down

0 comments on commit 7f0d0e5

Please sign in to comment.