diff --git a/config-debian-xfce.sh b/config-debian-xfce.sh deleted file mode 100755 index 5354dc9..0000000 --- a/config-debian-xfce.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -read -p "Enable autologin as user? >>> " UserName -if [ $UserName ] -then - sed -i "s/^.*autologin-user=.*$/autologin-user=$UserName/g" /etc/lightdm/lightdm.conf - sed -i "s/^.*autologin-user-timeout=.*$/autologin-user-timeout=0/g" /etc/lightdm/lightdm.conf - echo "Successfully configured autologin as $UserName" -else - echo 'Nothing changed.' -fi - diff --git a/config-debian.sh b/config-debian.sh index 2d7eb94..405a60e 100755 --- a/config-debian.sh +++ b/config-debian.sh @@ -60,7 +60,7 @@ echo # Debian 10 default to /bin/sh sed -i "s|/home/$NewUser:/bin/sh$|/home/$NewUser:/bin/bash|g" /etc/passwd # Debian 9 default to empty -sed -i "s|/home/$NewUser:$|/home/$NewUser:/bin/bash/g" /etc/passwd +sed -i "s|/home/$NewUser:$|/home/$NewUser:/bin/bash|g" /etc/passwd echo "<<< Allow the new user $NewUser to sudo without password" #### Option 1: Add the new user to %sudo group in /etc/sudoers file @@ -83,9 +83,16 @@ sed -i "s|^PermitRootLogin yes|#PermitRootLogin yes|g" /etc/ssh/sshd_config service sshd restart echo -#echo "<<< autologin for Xfce: /etc/lightdm/lightdm.conf" -#sed -i "s/^#autologin-user=$/autologin-user=$NewUser/g" /etc/lightdm/lightdm.conf -#sed -i "s/^#autologin-user-timeout=0$/autologin-user-timeout=0/g" /etc/lightdm/lightdm.conf +echo "<<< autologin for Xfce: /etc/lightdm/lightdm.conf" +read -p "<<< Enable xfce autologin as ($NewUser for autologin or anything else for no change): " XfceAutologinUsername +if [ $XfceAutologinUsername = $NewUser ] +then + sed -i "s/^.*autologin-user=.*$/autologin-user=$NewUser/g" /etc/lightdm/lightdm.conf + sed -i "s/^.*autologin-user-timeout=.*$/autologin-user-timeout=0/g" /etc/lightdm/lightdm.conf + echo "Successfully configured autologin as $NewUser" +else + echo 'Nothing changed >>>' +fi echo "<<< Configure autostart" if [ -f /etc/rc.local ] diff --git a/install-nodejs.sh b/install-nodejs.sh index ff922d6..6a31a17 100755 --- a/install-nodejs.sh +++ b/install-nodejs.sh @@ -1,6 +1,6 @@ #!/bin/bash -echo "Usage: setup.sh [nodeVersion]" +echo "Usage: this-script.sh [nodeVersion]" defaultVersion=16 @@ -8,7 +8,7 @@ if [ v$1 != v ] then nodeVersion=$1 else - read -p "Enter nodejs version (leave blank for default 16; 'nvm' for nvm) >> " nodeVersion + read -p "Enter nodejs version (leave blank for default $defaultVersion) >> " nodeVersion if [ ! $nodeVersion ] then nodeVersion=$defaultVersion @@ -16,16 +16,11 @@ else fi fi -if [ $nodeVersion == 'nvm' ] -then - echo "######## Installing nvm ############################" -else - sudo apt update - echo "######## Installing C++ build tools for Linux ########" - sudo apt install curl gcc g++ make python -y # Debian 11 has no python by default. +sudo apt update +echo "######## Installing C++ build tools for Linux ########" +sudo apt install curl gcc g++ make python -y # Debian 11 has no python by default. - echo "######## Installing nodejs v$nodeVersion ########" - echo From https://deb.nodesource.com/setup_$nodeVersion.x - curl -sL https://deb.nodesource.com/setup_$nodeVersion.x | sudo bash - && sudo apt install nodejs -y - echo "######## nodejs v$nodeVersion installed completely! ########" -fi +echo "######## Installing nodejs v$nodeVersion ########" +echo From https://deb.nodesource.com/setup_$nodeVersion.x +curl -sL https://deb.nodesource.com/setup_$nodeVersion.x | sudo bash - && sudo apt install nodejs -y +echo "######## nodejs v$nodeVersion installed completely! ########" diff --git a/install-nvm.sh b/install-nvm.sh new file mode 100755 index 0000000..e6bc1f9 --- /dev/null +++ b/install-nvm.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +echo "Usage: this-script.sh" + +defaultVersion=0.39.0 + +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v$defaultVersion/install.sh | bash