summaryrefslogtreecommitdiffstats
path: root/core/modules/systemd/data/opt/openslx
diff options
context:
space:
mode:
authorSebastian2016-04-25 12:01:08 +0200
committerSebastian2016-04-25 12:01:08 +0200
commit5acda3eaeabae9045609539303a8c12c4ce401f1 (patch)
tree7e71975f8570b05aafe2ea6ec0e242a8912387bb /core/modules/systemd/data/opt/openslx
parentinitial commit (diff)
downloadmltk-5acda3eaeabae9045609539303a8c12c4ce401f1.tar.gz
mltk-5acda3eaeabae9045609539303a8c12c4ce401f1.tar.xz
mltk-5acda3eaeabae9045609539303a8c12c4ce401f1.zip
merge with latest dev version
Diffstat (limited to 'core/modules/systemd/data/opt/openslx')
-rwxr-xr-xcore/modules/systemd/data/opt/openslx/scripts/systemd-shutdown_prescript50
-rwxr-xr-xcore/modules/systemd/data/opt/openslx/scripts/tty-init23
2 files changed, 73 insertions, 0 deletions
diff --git a/core/modules/systemd/data/opt/openslx/scripts/systemd-shutdown_prescript b/core/modules/systemd/data/opt/openslx/scripts/systemd-shutdown_prescript
new file mode 100755
index 00000000..3b5d7f92
--- /dev/null
+++ b/core/modules/systemd/data/opt/openslx/scripts/systemd-shutdown_prescript
@@ -0,0 +1,50 @@
+#!/bin/ash
+
+# This script gets called by ExecStartPre from the services
+# systemd-halt, systemd-poweroff, systemd-reboot. Pre-shutdown actions as
+# unmounting nfs shares etc. should go here.
+
+PATH=/bin:/usr/bin:/opt/openslx/bin
+
+# kill leftover processes
+
+umount_nfs_shares() {
+ for i in "$(mount | grep 'type nfs')"; do
+ share=$(echo "$i"|cut -f 3 -d " ")
+ echo "Unmounte nfs-Share $share ...."
+ umount "$share"
+ ERROR=$?
+ if [ $ERROR -eq 0 ]; then
+ echo "nfs-Share $share unmounted."
+ else
+ echo "Could not umount nfs share $share!"
+ ERRORLEVEL=1
+ fi
+ done
+}
+
+umount_samba_shares() {
+ for i in "$(mount | grep 'type cifs')"; do
+ share=$(echo $i|cut -f 3 -d " ")
+ echo "Unmounte cifs-Share $share ...."
+ umount "$share"
+ ERROR=$?
+ if [ $ERROR -eq 0 ]; then
+ echo "cifs-Share $share unmounted."
+ else
+ echo "Could not umount cifs share $share!"
+ ERRORLEVEL=1
+ fi
+ done
+}
+
+# Searching for nfs-shares in mtab:
+if [ $(echo /etc/mtab | cut -d " " -f 3 | grep -q nfs) ]; then
+ umount_nfs_shares
+fi
+
+# Searching for samba-shares:
+if [ $(echo /etc/mtab|cut -d " " -f 3 | grep -q cifs) ]; then
+ umount_samba_shares
+fi
+exit $ERRORLEVEL
diff --git a/core/modules/systemd/data/opt/openslx/scripts/tty-init b/core/modules/systemd/data/opt/openslx/scripts/tty-init
new file mode 100755
index 00000000..a157854d
--- /dev/null
+++ b/core/modules/systemd/data/opt/openslx/scripts/tty-init
@@ -0,0 +1,23 @@
+#!/bin/ash
+
+[ -c "/dev/$1" ] || exit 0
+
+exec > "/dev/$1"
+echo -en "\e]P0232323" #black
+echo -en "\e]P82B2B2B" #darkgrey
+echo -en "\e]P1D75F5F" #darkred
+echo -en "\e]P9E33636" #red
+echo -en "\e]P287AF5F" #darkgreen
+echo -en "\e]PA98E34D" #green
+echo -en "\e]P3D7AF87" #brown
+echo -en "\e]PBFFD75F" #yellow
+echo -en "\e]P48787AF" #darkblue
+echo -en "\e]PC7373C9" #blue
+echo -en "\e]P5BD53A5" #darkmagenta
+echo -en "\e]PDD633B2" #magenta
+echo -en "\e]P65FAFAF" #darkcyan
+echo -en "\e]PE44C9C9" #cyan
+echo -en "\e]P7E5E5E5" #lightgrey
+echo -en "\e]PFFFFFFF" #white
+echo -en '\033c' #clear
+