Handle dangling symlink /etc/systemd/system/display-manager.service in postrm scrypt...
authorAndriy Grytsenko <andrej@rep.kiev.ua>
Sun, 23 Nov 2014 19:33:01 +0000 (21:33 +0200)
committerAndriy Grytsenko <andrej@rep.kiev.ua>
Sun, 23 Nov 2014 19:33:01 +0000 (21:33 +0200)
debian/lxdm.postrm

index 10cc51e..9b64725 100644 (file)
@@ -15,6 +15,13 @@ if [ "$1" = "purge" ]; then
   done
 fi
 
+# Test if /etc/systemd/system/display-manager.service is broken now
+SERVICE_FILE=/etc/systemd/system/display-manager.service
+if [ -L $SERVICE_FILE ] && [ ! -e $SERVICE_FILE ]; then
+  echo "WARN: clearing dangling symlink $SERVICE_FILE" >&2
+  rm -f $SERVICE_FILE
+fi
+
 #DEBHELPER#
 
 exit 0