diff options
author | Jonathan Bauer | 2015-04-07 17:43:23 +0200 |
---|---|---|
committer | Jonathan Bauer | 2015-04-07 17:43:23 +0200 |
commit | b1074927e6848d7370c6d4a1b11b7149d6660a77 (patch) | |
tree | 89dfef802d48522d297632cb77fe13825707ff3e /remote/modules/systemd/data/opt/openslx/scripts/systemd-shutdown_prescript | |
parent | [pam-common-share] rudimentary nfs-support for common share (diff) | |
parent | [hdd-boot] michi's werk (diff) | |
download | tm-scripts-mergetest.tar.gz tm-scripts-mergetest.tar.xz tm-scripts-mergetest.zip |
Merge remote-tracking branch 'remotes/origin/test' into mergetestmergetest
Diffstat (limited to 'remote/modules/systemd/data/opt/openslx/scripts/systemd-shutdown_prescript')
-rwxr-xr-x | remote/modules/systemd/data/opt/openslx/scripts/systemd-shutdown_prescript | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/remote/modules/systemd/data/opt/openslx/scripts/systemd-shutdown_prescript b/remote/modules/systemd/data/opt/openslx/scripts/systemd-shutdown_prescript index 3b5d7f92..e3a45ecf 100755 --- a/remote/modules/systemd/data/opt/openslx/scripts/systemd-shutdown_prescript +++ b/remote/modules/systemd/data/opt/openslx/scripts/systemd-shutdown_prescript @@ -38,6 +38,14 @@ umount_samba_shares() { done } +backup_users(){ + # create patch files to backup the users created by the openslx, so we can restore then in the next session. + for file in passwd shadow group; do + diff -u /home/openslx/.$file.backup /etc/$file > /home/openslx/.$file.patch + done + echo "Patch of /etc/{passwd,shadow,group} generated at /home/openslx/.{passwd,shadow,group}.patch" +} + # Searching for nfs-shares in mtab: if [ $(echo /etc/mtab | cut -d " " -f 3 | grep -q nfs) ]; then umount_nfs_shares @@ -47,4 +55,9 @@ fi if [ $(echo /etc/mtab|cut -d " " -f 3 | grep -q cifs) ]; then umount_samba_shares fi + +if [ -d /home/openslx ]; then + backup_users +fi + exit $ERRORLEVEL |