File: migrate-to-0.6.3.0.sh

package info (click to toggle)
diaspora-installer 0.7.6.1+debian1
  • links: PTS, VCS
  • area: contrib
  • in suites: bullseye, buster, sid
  • size: 456 kB
  • sloc: sh: 895; makefile: 8
file content (61 lines) | stat: -rw-r--r-- 1,960 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# This is required if updating from a version before 0.6.3.0
test "$(getent passwd diaspora | cut -d: -f6)" = "/var/lib/$user"  ||\
 usermod -d /var/lib/diaspora diaspora
mkdir -p /var/lib/diaspora

for i in public .bundle Gemfile.lock
do
  if [ -L /usr/share/diaspora/$i ]; then
    echo -n ""
  elif [ -d /usr/share/diaspora/$i ]; then
    mv /usr/share/diaspora/$i /var/lib/diaspora
    ln -sf /var/lib/diaspora/$i /usr/share/diaspora/$i
  fi
  mkdir -p /var/lib/diaspora/$i
done

if [ -L /usr/share/diaspora/app/assets ]; then
  echo -n ""
elif [ -d /usr/share/diaspora/app/assets ]; then
  mkdir -p /var/lib/diaspora/app-assets
  ln -sf /var/lib/diaspora/app-assets /usr/share/diaspora/app/assets
fi
mkdir -p /var/lib/diaspora/app-assets

if [ -L /usr/share/diaspora/vendor/bundle ]; then
  echo -n ""
elif [ -d /usr/share/diaspora/vendor/bundle ]; then
  mv /usr/share/diaspora/vendor/bundle /var/lib/diaspora/vendor-bundle
  ln -sf /var/lib/diaspora/vendor-bundle /usr/share/diaspora/vendor/bundle
fi
mkdir -p /var/lib/diaspora/vendor-bundle

mkdir -p /run/diaspora
if [ -L /usr/share/diaspora/tmp ]; then
  echo -n ""
elif [ -d /usr/share/diaspora/tmp ]; then
  mv /usr/share/diaspora/tmp/* /run/diaspora/
  rmdir /usr/share/diaspora/tmp/
  ln -sf /run/diaspora /usr/share/diaspora/tmp
fi
mkdir -p /run/diaspora/pids

mkdir -p /var/log/diaspora
if [ -L /usr/share/diaspora/log ]; then
  echo -n ""
elif [ -d /usr/share/diaspora/log ]; then
  mv /usr/share/diaspora/log/* /var/log/diaspora/
  rm -rf /usr/share/diaspora/log
  ln -sf /var/log/diaspora /usr/share/diaspora/log
fi

if [ -L /usr/share/diaspora/db/schema.rb ]; then
  echo -n ""
elif [ -f /usr/share/diaspora/db/schema.rb ]; then
  mv /usr/share/diaspora/db/schema.rb /var/lib/diaspora/db-schema.rb
  ln -sf /var/lib/diaspora/db-schema.rb /usr/share/diaspora/db/schema.rb
fi

chown diaspora: -R /var/lib/diaspora
chown diaspora: -R /var/log/diaspora
chown diaspora:www-data -R /run/diaspora