mirror of
https://github.com/SuperBFG7/ympd
synced 2025-01-12 18:30:36 +00:00
Fix: install state files #64
This commit is contained in:
parent
cac4e8bfd5
commit
9d1236e92a
@ -10,10 +10,6 @@ post_upgrade() {
|
||||
getent passwd mympd > /dev/null
|
||||
[ "$?" = "2" ] && useradd --system -d /var/lib/mympd -s /usr/sbin/nologin -g mympd mympd
|
||||
|
||||
# fix ownership of /var/lib/mympd
|
||||
echo "INFO: Fixing ownership of /var/lib/mympd"
|
||||
chown -R mympd.mympd /var/lib/mympd
|
||||
|
||||
# link music directory to mympd if not already exising
|
||||
echo "INFO: Trying to link musicdir to library"
|
||||
if [ -f /etc/mpd.conf ]
|
||||
@ -64,6 +60,17 @@ post_upgrade() {
|
||||
fi
|
||||
done
|
||||
|
||||
#default state files
|
||||
[ -f /var/lib/mympd/state/jukeboxMode ] || echo -n "0" > /var/lib/mympd/state/jukeboxMode
|
||||
[ -f /var/lib/mympd/state/jukeboxPlaylist ] || echo -n "Database" > /var/lib/mympd/state/jukeboxPlaylist
|
||||
[ -f /var/lib/mympd/state/jukeboxQueueLength ] || echo -n "1" > /var/lib/mympd/state/jukeboxQueueLength
|
||||
[ -f /var/lib/mympd/state/notificationPage ] || echo -n "true" > /var/lib/mympd/state/notificationPage
|
||||
[ -f /var/lib/mympd/state/notificationWeb ] || echo -n "false" > /var/lib/mympd/state/notificationWeb
|
||||
|
||||
# fix ownership of /var/lib/mympd
|
||||
echo "INFO: Fixing ownership of /var/lib/mympd"
|
||||
chown -R mympd.mympd /var/lib/mympd
|
||||
|
||||
# move config into place unless already existing
|
||||
if [ ! -f /etc/mympd/mympd.conf ]
|
||||
then
|
||||
|
@ -44,9 +44,6 @@ getent group mympd > /dev/null
|
||||
getent passwd mympd > /dev/null
|
||||
[ "$?" = "2" ] && useradd -r mympd -g mympd -d /var/lib/mympd -s /usr/sbin/nologin
|
||||
|
||||
echo "Fixing ownership of /var/lib/mympd"
|
||||
chown -R mympd.mympd /var/lib/mympd
|
||||
|
||||
if [ -d /etc/systemd ]
|
||||
then
|
||||
[ -d /usr/lib/systemd/system ] || mkdir -p /usr/lib/systemd/system
|
||||
@ -78,6 +75,16 @@ do
|
||||
fi
|
||||
done
|
||||
|
||||
#default state files
|
||||
[ -f /var/lib/mympd/state/jukeboxMode ] || echo -n "0" > /var/lib/mympd/state/jukeboxMode
|
||||
[ -f /var/lib/mympd/state/jukeboxPlaylist ] || echo -n "Database" > /var/lib/mympd/state/jukeboxPlaylist
|
||||
[ -f /var/lib/mympd/state/jukeboxQueueLength ] || echo -n "1" > /var/lib/mympd/state/jukeboxQueueLength
|
||||
[ -f /var/lib/mympd/state/notificationPage ] || echo -n "true" > /var/lib/mympd/state/notificationPage
|
||||
[ -f /var/lib/mympd/state/notificationWeb ] || echo -n "false" > /var/lib/mympd/state/notificationWeb
|
||||
|
||||
echo "Fixing ownership of /var/lib/mympd"
|
||||
chown -R mympd.mympd /var/lib/mympd
|
||||
|
||||
# move config into place unless already existing
|
||||
if [ ! -f /etc/mympd/mympd.conf ]
|
||||
then
|
||||
|
14
debian/postinst
vendored
14
debian/postinst
vendored
@ -6,8 +6,7 @@ getent group mympd > /dev/null
|
||||
getent passwd mympd > /dev/null
|
||||
[ "$?" = "2" ] && useradd -r mympd -g mympd -d /var/lib/mympd -s /usr/sbin/nologin
|
||||
|
||||
echo "Fixing ownership of /var/lib/mympd"
|
||||
chown -R mympd.mympd /var/lib/mympd
|
||||
|
||||
|
||||
echo "Trying to link musicdir to library"
|
||||
if [ -f /etc/mpd.conf ]
|
||||
@ -48,7 +47,6 @@ do
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
# move config into place unless already existing
|
||||
if [ ! -f /etc/mympd/mympd.conf ]
|
||||
then
|
||||
@ -57,6 +55,16 @@ else
|
||||
echo "mympd.conf installed as mympd.conf.dist"
|
||||
fi
|
||||
|
||||
#default state files
|
||||
[ -f /var/lib/mympd/state/jukeboxMode ] || echo -n "0" > /var/lib/mympd/state/jukeboxMode
|
||||
[ -f /var/lib/mympd/state/jukeboxPlaylist ] || echo -n "Database" > /var/lib/mympd/state/jukeboxPlaylist
|
||||
[ -f /var/lib/mympd/state/jukeboxQueueLength ] || echo -n "1" > /var/lib/mympd/state/jukeboxQueueLength
|
||||
[ -f /var/lib/mympd/state/notificationPage ] || echo -n "true" > /var/lib/mympd/state/notificationPage
|
||||
[ -f /var/lib/mympd/state/notificationWeb ] || echo -n "false" > /var/lib/mympd/state/notificationWeb
|
||||
|
||||
echo "Fixing ownership of /var/lib/mympd"
|
||||
chown -R mympd.mympd /var/lib/mympd
|
||||
|
||||
if [ -d /etc/mympd/ssl ]
|
||||
then
|
||||
echo "Certificates already created"
|
||||
|
Loading…
Reference in New Issue
Block a user