forked from intel/esp-profile-ubuntu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
post.sh
executable file
·36 lines (30 loc) · 862 Bytes
/
post.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# Copyright (C) 2019 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
#this is provided while using Utility OS
source /opt/bootstrap/functions
# --- Cleanup ---
if [ ! -z "${param_docker_login_user}" ] && [ ! -z "${param_docker_login_pass}" ]; then
run "Logout from a Docker registry" \
"docker logout" \
"$TMP/provisioning.log"
fi
if [ $freemem -lt 6291456 ]; then
run "Cleaning up" \
"killall dockerd &&
sleep 3 &&
swapoff $ROOTFS/swap &&
rm $ROOTFS/swap &&
while (! rm -fr $ROOTFS/tmp/ > /dev/null ); do sleep 2; done" \
"$TMP/provisioning.log"
fi
umount $BOOTFS &&
umount $ROOTFS &&
if [[ $param_diskencrypt == 'true' ]]; then
cryptsetup luksClose root 2>&1 | tee -a /dev/console
fi
if [[ $param_release == 'prod' ]]; then
poweroff
else
reboot
fi