summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-02-19 16:51:46 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-02-19 16:53:54 +0100
commitabd8dcd9db6cf2bec4e6441135fc1a48d36f98fd (patch)
treebc8b63e8974231cbaba52329583cdaadf8eef8bb
parentb7095f04c13f1f6bb1060575160c83b79cc5f2f5 (diff)
downloaditzks-systems-abd8dcd9db6cf2bec4e6441135fc1a48d36f98fd.tar.gz
itzks-systems-abd8dcd9db6cf2bec4e6441135fc1a48d36f98fd.tar.bz2
itzks-systems-abd8dcd9db6cf2bec4e6441135fc1a48d36f98fd.zip
etc/mklocaluser.d/60-itzks-systems-roamingworkstation_disable-welcome-page: Add script that disables Debian Edu's welcome page on Roaming Workstations.
-rwxr-xr-xetc/mklocaluser.d/60-itzks-systems-roamingworkstation_disable-welcome-page43
1 files changed, 43 insertions, 0 deletions
diff --git a/etc/mklocaluser.d/60-itzks-systems-roamingworkstation_disable-welcome-page b/etc/mklocaluser.d/60-itzks-systems-roamingworkstation_disable-welcome-page
new file mode 100755
index 0000000..9a6bb03
--- /dev/null
+++ b/etc/mklocaluser.d/60-itzks-systems-roamingworkstation_disable-welcome-page
@@ -0,0 +1,43 @@
+#!/bin/sh
+# Make Debian Edu's show-welcome-page think that the welcome page has already been shown.
+
+set -e
+
+HOMEDIR=/home/$USER
+
+# Allow lookup script to be replaced using /etc/debian-edu/config
+GETDEFAULTHOMEPAGE=$(/usr/share/debian-edu-config/tools/get-default-homepage || true)
+
+if [ -e /etc/debian-edu/config ] ; then
+ . /etc/debian-edu/config
+fi
+
+if [ "$GETDEFAULTHOMEPAGE" ] &&
+ echo "$PROFILE" | egrep -q 'Main-Server|Workstation|Roaming-Workstation|LTSP-Server|Minimal' ; then
+ for lang in $(echo $LANGCODE | tr : " "); do
+ if wget -q -O /dev/null ${GETDEFAULTHOMEPAGE}index.html.$lang ; then
+ welcomeurl="${GETDEFAULTHOMEPAGE}index.html.$lang"
+ break
+ else
+ welcomeurl=$GETDEFAULTHOMEPAGE || true
+ fi
+ done
+else
+ welcomeurl=http://www.skolelinux.org/
+fi
+
+if [ -z "$welcomeurl" ] || [ "about:blank" = "$welcomeurl" ]; then
+ exit 0
+fi
+
+flagdir="$HOMEDIR/.debian-edu"
+flagfile="$flagdir/welcome-page-shown"
+
+if [ ! -f "$flagfile" ] ; then
+ echo "$welcomeurl" > "$flagfile"
+else
+ oldwelcomeurl="$(cat $flagfile)"
+ if [ "$welcomeurl" != "$oldwelcomeurl" ] ; then
+ echo "$welcomeurl" > "$flagfile"
+ fi
+fi