Skip to content

Commit c092613

Browse files
committed
removing /export/home since it was empty, found in manual check
1 parent b837233 commit c092613

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

files/common/var/lib/delphix-platform/export-home

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,34 @@ if mountpoint -q /export/home; then
3030
fi
3131

3232
# /export/home is not mounted, check if /home is mounted
33+
# Check if /home is mounted
3334
if mountpoint -q /home; then
34-
echo '/home is mounted. Proceeding with the unmount check for /export/home.'
35+
echo "/home is mounted. Proceeding with /export/home cleanup."
36+
# If /export/home exists
37+
if [ -d /export/home ]; then
38+
echo "/export/home exists. Attempting to remove it..."
39+
rmdir /export/home 2>/dev/null
40+
if [ $? -eq 0 ]; then
41+
echo "/export/home directory removed successfully."
42+
else
43+
echo "/export/home is not empty. Please clean it manually before running this script."
44+
exit 1
45+
fi
46+
fi
3547
else
36-
echo '/home is not mounted. Aborting to avoid risk of data loss.'
48+
echo "/home is not mounted. Aborting to avoid risk of data loss."
3749
exit 1
3850
fi
3951

40-
# Ensure /export directory exists
52+
# Ensure /export exists
4153
mkdir -p /export
4254

4355
# Create symlink
44-
echo 'Creating symlink: /export/home -> /home'
56+
echo "Creating symlink: /export/home -> /home"
4557
ln -s /home /export/home
4658
if [ $? -eq 0 ]; then
47-
echo 'Symlink created successfully.'
59+
echo "Symlink created successfully."
4860
else
49-
echo 'Failed to create symlink. Please check permissions and try again.'
61+
echo "Failed to create symlink. Please check permissions and try again."
5062
exit 1
5163
fi

0 commit comments

Comments
 (0)