Fix /etc/motd generation
This commit is contained in:
@@ -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).
|
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:
|
- Using `caja` to access sftp shares:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
- Using [Filezilla](https://filezilla-project.org/download.php?type=client) to access sftp shares:
|
- Using [Filezilla](https://filezilla-project.org/download.php?type=client) to access sftp shares:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
#### Samba file shares
|
#### Samba file shares
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ generate-services() {
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
ExecStart=$script > /etc/motd
|
ExecStart=/usr/bin/bash -c '$script > /etc/motd'
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=default.target
|
WantedBy=default.target
|
||||||
|
|||||||
@@ -29,15 +29,16 @@ else
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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://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"
|
"https://download1.rstudio.org/desktop/centos7/x86_64/rstudio-${2}-x86_64.rpm" &&
|
||||||
|
desktop_file="/usr/share/applications/rstudio-R4.desktop" &&
|
||||||
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"
|
||||||
[[ -f "$desktop_file" ]] && \
|
exit 0
|
||||||
sed -i "s|/opt/R/.*/bin/R|/opt/R/$1/bin/R|" "$desktop_file"
|
else
|
||||||
|
echo "R and RStudio update failed!"
|
||||||
exit $?
|
exit 1
|
||||||
|
fi
|
||||||
@@ -28,7 +28,7 @@ if ! id -u "$user" &>/dev/null; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
password="${password:-$user}" # For samba
|
password="${password:-$user}"
|
||||||
|
|
||||||
if ask_ok "Change user $user's password to $password?"; then
|
if ask_ok "Change user $user's password to $password?"; then
|
||||||
echo "$user":"$password" | chpasswd
|
echo "$user":"$password" | chpasswd
|
||||||
|
|||||||
Reference in New Issue
Block a user