diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2022-01-07 16:43:38 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2022-01-07 16:52:12 +0100 |
commit | 0424d6c66ec4e58dbb9074605cc8970c4620a40f (patch) | |
tree | e98210c649cb99ce7875da0ea0395fc56841ac16 /sbin/diskless-workstation-shell.bookworm | |
parent | 4309962ad0e0149fdecb0aede4f5e21586a9ac80 (diff) | |
download | itzks-systems-0424d6c66ec4e58dbb9074605cc8970c4620a40f.tar.gz itzks-systems-0424d6c66ec4e58dbb9074605cc8970c4620a40f.tar.bz2 itzks-systems-0424d6c66ec4e58dbb9074605cc8970c4620a40f.zip |
sbin/diskless-workstation-shell.bookworm: Add file. Update d/copyright.
Diffstat (limited to 'sbin/diskless-workstation-shell.bookworm')
-rwxr-xr-x | sbin/diskless-workstation-shell.bookworm | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/sbin/diskless-workstation-shell.bookworm b/sbin/diskless-workstation-shell.bookworm new file mode 100755 index 0000000..f191006 --- /dev/null +++ b/sbin/diskless-workstation-shell.bookworm @@ -0,0 +1,66 @@ +#!/bin/bash + +# Copyright (C) 2011-2021 by Mike Gabriel <mike.gabriel@it-zukunft-schule.de> + +# 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.3 +DLW_SHELL="bash" +CHROOT="/srv/ltsp/amd64+bookworm/" + +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" <<EOF +#!/bin/bash +mount -tproc proc /proc &> /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 |