From b69afb0895f7bf90803c4aaa9c8f6e649198f9f1 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 7 Nov 2018 15:19:35 +0100 Subject: scripts: Provide diskless-workstation-shell for jessie and stretch. --- sbin/diskless-workstation-shell | 68 +-------------------------------- sbin/diskless-workstation-shell.jessie | 66 ++++++++++++++++++++++++++++++++ sbin/diskless-workstation-shell.stretch | 66 ++++++++++++++++++++++++++++++++ 3 files changed, 133 insertions(+), 67 deletions(-) mode change 100755 => 120000 sbin/diskless-workstation-shell create mode 100755 sbin/diskless-workstation-shell.jessie create mode 100755 sbin/diskless-workstation-shell.stretch diff --git a/sbin/diskless-workstation-shell b/sbin/diskless-workstation-shell deleted file mode 100755 index fd0e204..0000000 --- a/sbin/diskless-workstation-shell +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash - -# Copyright (C) 2011 by Mike Gabriel - -# This script is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This script is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the -# Free Software Foundation, Inc., -# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - -set -e - -VERSION=0.1 -DLW_SHELL="bash" -CHROOT="/srv/ltsp/amd64.stretch/" - -test -e "$CHROOT" || { - echo "ERROR: Diskless workstation chroot does not exist at $CHROOT." - exit -1 -} - -[ "x$USER" == "xroot" ] || { - echo "ERROR: Diskless workstation management has to be performed as root." - exit -2 -} - -cat > "$CHROOT/dlw_shell.sh" < /dev/null -mount /dev/pts &> /dev/null -export HOME=/root -export LTSP_HANDLE_DAEMONS="false" - -# export the proxy server (if any) to the shell. -export http_proxy=http://webcache.intern:3128 -export https_proxy=http://webcache.intern:3128 -export ftp_proxy=http://webcache.intern:3128 - -echo 'This shell has been started in your Diskless Workstation chroot environment.' -echo 'All changes performed here will take effect on your Diskless Workstations' -echo 'after their next (re)boot. So be careful!!!' -echo -echo "To return from this chroot shell hit STRG+D or type ,,exit'' on the" -echo 'command line...' -echo - -/bin/$DLW_SHELL - -umount -l /proc &> /dev/null -umount -l /dev/pts &> /dev/null - -echo -echo "Diskless Workstation Shell has exited." -echo -EOF -chmod u+x "$CHROOT/dlw_shell.sh" -chroot "$CHROOT" /dlw_shell.sh - diff --git a/sbin/diskless-workstation-shell b/sbin/diskless-workstation-shell new file mode 120000 index 0000000..d775138 --- /dev/null +++ b/sbin/diskless-workstation-shell @@ -0,0 +1 @@ +diskless-workstation-shell.stretch \ No newline at end of file diff --git a/sbin/diskless-workstation-shell.jessie b/sbin/diskless-workstation-shell.jessie new file mode 100755 index 0000000..ecf5ec7 --- /dev/null +++ b/sbin/diskless-workstation-shell.jessie @@ -0,0 +1,66 @@ +#!/bin/bash + +# Copyright (C) 2011 by Mike Gabriel + +# This script is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This script is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +set -e + +VERSION=0.2 +DLW_SHELL="bash" +CHROOT="/srv/ltsp/i386.jessie/" + +test -e "$CHROOT" || { + echo "ERROR: Diskless workstation chroot does not exist at $CHROOT." + exit -1 +} + +[ "x$USER" == "xroot" ] || { + echo "ERROR: Diskless workstation management has to be performed as root." + exit -2 +} + +cat > "$CHROOT/dlw_shell.sh" < /dev/null +mount /dev/pts &> /dev/null +export HOME=/root +export LTSP_HANDLE_DAEMONS="false" + +# export the proxy server (if any) to the shell. +export http_proxy=http://webcache.intern:3128 +export https_proxy=http://webcache.intern:3128 +export ftp_proxy=http://webcache.intern:3128 + +echo 'This shell has been started in your Diskless Workstation chroot environment.' +echo 'All changes performed here will take effect on your Diskless Workstations' +echo 'after their next (re)boot. So be careful!!!' +echo +echo "To return from this chroot shell hit STRG+D or type ,,exit'' on the" +echo 'command line...' +echo + +/bin/$DLW_SHELL + +umount -l /proc &> /dev/null +umount -l /dev/pts &> /dev/null + +echo +echo "Diskless Workstation Shell has exited." +echo +EOF +chmod u+x "$CHROOT/dlw_shell.sh" +chroot "$CHROOT" /dlw_shell.sh diff --git a/sbin/diskless-workstation-shell.stretch b/sbin/diskless-workstation-shell.stretch new file mode 100755 index 0000000..163c68f --- /dev/null +++ b/sbin/diskless-workstation-shell.stretch @@ -0,0 +1,66 @@ +#!/bin/bash + +# Copyright (C) 2011 by Mike Gabriel + +# This script is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This script is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +set -e + +VERSION=0.2 +DLW_SHELL="bash" +CHROOT="/srv/ltsp/amd64+stretch/" + +test -e "$CHROOT" || { + echo "ERROR: Diskless workstation chroot does not exist at $CHROOT." + exit -1 +} + +[ "x$USER" == "xroot" ] || { + echo "ERROR: Diskless workstation management has to be performed as root." + exit -2 +} + +cat > "$CHROOT/dlw_shell.sh" < /dev/null +mount /dev/pts &> /dev/null +export HOME=/root +export LTSP_HANDLE_DAEMONS="false" + +# export the proxy server (if any) to the shell. +export http_proxy=http://webcache.intern:3128 +export https_proxy=http://webcache.intern:3128 +export ftp_proxy=http://webcache.intern:3128 + +echo 'This shell has been started in your Diskless Workstation chroot environment.' +echo 'All changes performed here will take effect on your Diskless Workstations' +echo 'after their next (re)boot. So be careful!!!' +echo +echo "To return from this chroot shell hit STRG+D or type ,,exit'' on the" +echo 'command line...' +echo + +/bin/$DLW_SHELL + +umount -l /proc &> /dev/null +umount -l /dev/pts &> /dev/null + +echo +echo "Diskless Workstation Shell has exited." +echo +EOF +chmod u+x "$CHROOT/dlw_shell.sh" +chroot "$CHROOT" /dlw_shell.sh -- cgit v1.2.3