File: check-symlink.sh

package info (click to toggle)
octplot 0.3.9-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,572 kB
  • ctags: 1,494
  • sloc: cpp: 7,570; ansic: 4,595; sh: 617; makefile: 122
file content (32 lines) | stat: -rw-r--r-- 1,154 bytes parent folder | download | duplicates (2)
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
#!/bin/sh

# Check the octave-config symlink; 

status=$(/usr/sbin/update-alternatives --display octave-config | grep -c "status is manual");
version_false=$(file -n /etc/alternatives/octave-config | grep -c 2.1.71)
symlink_false=$(file -n /etc/alternatives/octave-config | grep -c "broken")
# Normal output of file for a broken symlink:
# 	$ file file2
# 	file2: broken symbolic link to `file1'
fqdn=$(/bin/hostname --fqdn);

if [ $status == "1" ] && [ $version_false == "1" ] && [ $symlink_false == "1" ]
  then
    echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    echo "  octave-config alternative symlink is set to 'manual'"
    echo "  and pointing to a non-existent octave-config-2.1.71."
    echo
    echo "  If you are the buildd admin of this machine, please read"
    echo "    http://lists.debian.org/debian-devel/2006/01/msg01566.html"
    echo "  for an explanation."
    echo
    echo "  FQDN of this host: $fqdn"
    echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"

  fi

/usr/sbin/update-alternatives --display octave-config 
ls -l /usr/bin/oct*
ls -l /etc/alternatives/oct*

exit $status