Fix /etc/motd generation

This commit is contained in:
2022-01-26 15:38:51 -05:00
parent 103b0c682b
commit 2efeb4e887
4 changed files with 16 additions and 13 deletions

View File

@@ -91,9 +91,11 @@ Files can be transferred to/from the server using `sftp`.
Users can access the server directly through a terminal (text-based) ssh client (`ssh` in OSX/Linux, or [`PuTTY`](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) in Windows) or via a GUI SFTP program such as [Filezilla](https://filezilla-project.org/download.php?type=client) or [WinSCP](https://winscp.net/eng/index.php). Linux users can access and mount the SFTP share directly within most file managers or by using [`sshfs`](https://www.digitalocean.com/community/tutorials/how-to-use-sshfs-to-mount-remote-file-systems-over-ssh).
- Using `caja` to access sftp shares:
![Caja SFTP Example](manual-images/sftp-native-linux.png)
- Using [Filezilla](https://filezilla-project.org/download.php?type=client) to access sftp shares:
![Filezilla SFTP Example](manual-images/filezilla.png)
#### Samba file shares

View File

@@ -314,7 +314,7 @@ generate-services() {
[Service]
Type=simple
ExecStart=$script > /etc/motd
ExecStart=/usr/bin/bash -c '$script > /etc/motd'
[Install]
WantedBy=default.target

View File

@@ -29,15 +29,16 @@ else
exit 1
fi
ask_ok "Update R to version $1 and RStudio to version $2?" || exit $?
ask_ok "Update R to version $1 and RStudio to version $2?" || exit
sudo dnf install -y "https://cdn.rstudio.com/r/centos-7/pkgs/R-${1}-1-1.x86_64.rpm" \
if sudo dnf install -y "https://cdn.rstudio.com/r/centos-7/pkgs/R-${1}-1-1.x86_64.rpm" \
"https://download2.rstudio.org/server/centos7/x86_64/rstudio-server-rhel-${2}-x86_64.rpm" \
"https://download1.rstudio.org/desktop/centos7/x86_64/rstudio-${2}-x86_64.rpm"
desktop_file="/usr/share/applications/rstudio-R4.desktop"
[[ -f "$desktop_file" ]] && \
sed -i "s|/opt/R/.*/bin/R|/opt/R/$1/bin/R|" "$desktop_file"
exit $?
"https://download1.rstudio.org/desktop/centos7/x86_64/rstudio-${2}-x86_64.rpm" &&
desktop_file="/usr/share/applications/rstudio-R4.desktop" &&
[[ -f "$desktop_file" ]] && sed -i "s|/opt/R/.*/bin/R|/opt/R/$1/bin/R|" "$desktop_file"; then
echo "Successfully updated R and RStudio"
exit 0
else
echo "R and RStudio update failed!"
exit 1
fi

View File

@@ -28,7 +28,7 @@ if ! id -u "$user" &>/dev/null; then
exit 1
fi
password="${password:-$user}" # For samba
password="${password:-$user}"
if ask_ok "Change user $user's password to $password?"; then
echo "$user":"$password" | chpasswd