Use find in clean-all instead of ls
This commit is contained in:
parent
91a5a24b1b
commit
f2176428bc
@ -17,8 +17,8 @@ rm -f /srv/build/lxc/packages.sig
|
|||||||
echo '{"apps":{},"images":{}}' >/srv/build/lxc/packages
|
echo '{"apps":{},"images":{}}' >/srv/build/lxc/packages
|
||||||
|
|
||||||
# Stop running containers
|
# Stop running containers
|
||||||
for SERVICE in $(ls -1 /run/openrc/started/lxc-*); do
|
for SERVICE in $(find /run/openrc/started -name 'lxc-*'); do
|
||||||
service ${SERVICE} stop
|
service $(basename ${SERVICE}) stop
|
||||||
done
|
done
|
||||||
|
|
||||||
# Remove services
|
# Remove services
|
||||||
@ -29,13 +29,13 @@ rc-update -u
|
|||||||
rm -rf /var/lib/lxc/*
|
rm -rf /var/lib/lxc/*
|
||||||
|
|
||||||
# Remove application data
|
# Remove application data
|
||||||
for DIR in $(ls -1 /srv | grep -v ^build$); do
|
for DIR in $(find /srv ! -path /srv/build -maxdepth 1 -mindepth 1); do
|
||||||
rm -rf /srv/${DIR}
|
rm -rf ${DIR}
|
||||||
done
|
done
|
||||||
|
|
||||||
# Remove nginx configs
|
# Remove nginx configs
|
||||||
for FILE in $(ls -1 /etc/nginx/conf.d | grep -Ev ^(apkrepo|default).conf$); do
|
for CONF in $(find /etc/nginx/conf.d -name '*.conf' -a ! -name apkrepo.conf -a ! -name default.conf); do
|
||||||
rm -f /etc/nginx/conf.d/${FILE}
|
rm -f ${CONF}
|
||||||
done
|
done
|
||||||
service nginx reload
|
service nginx reload
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user