Attempt at making init scripts container aware
This commit is contained in:
25
SNAP/usher
25
SNAP/usher
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
@@ -7,25 +7,22 @@ case $1 in
|
||||
exit 0
|
||||
;;
|
||||
postinst)
|
||||
if [[ ${TARGET} ]]; then
|
||||
chroot ${TARGET} update-rc required
|
||||
else
|
||||
update-rc required
|
||||
update-rc required
|
||||
|
||||
if [ ! -f /etc/fstab ]; then
|
||||
cp /usr/share/initscripts/fstab /etc/fstab
|
||||
fi
|
||||
|
||||
if [ ! -f ${TARGET}/etc/modules.conf ]; then
|
||||
cp ${TARGET}/usr/share/initscripts/modules.conf \
|
||||
${TARGET}/etc/modules.conf
|
||||
if [ ! -f /etc/modules.conf ]; then
|
||||
cp /usr/share/initscripts/modules.conf /etc/modules.conf
|
||||
fi
|
||||
|
||||
if [ ! -f ${TARGET}/etc/default/halt ]; then
|
||||
cp ${TARGET}/usr/share/initscripts/halt.default \
|
||||
${TARGET}/etc/default/halt
|
||||
if [ ! -f /etc/default/halt ]; then
|
||||
cp /usr/share/initscripts/halt.default /etc/default/halt
|
||||
fi
|
||||
|
||||
if [ ! -f ${TARGET}/etc/default/rcS ]; then
|
||||
cp ${TARGET}/usr/share/initscripts/rcS.default \
|
||||
${TARGET}/etc/default/rcS
|
||||
if [ ! -f /etc/default/rcS ]; then
|
||||
cp /usr/share/initscripts/rcS.default /etc/default/rcS
|
||||
fi
|
||||
;;
|
||||
prerm)
|
||||
|
||||
Reference in New Issue
Block a user