aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile14
-rw-r--r--NEWS23
-rwxr-xr-xadd-group12
-rwxr-xr-xadd-service84
-rwxr-xr-xadd-shell4
-rwxr-xr-xadd-user6
-rwxr-xr-xadd-webapp2
-rwxr-xr-xcreate-file10
-rwxr-xr-xcreate-ssl-certificate20
-rwxr-xr-xdel-group2
-rwxr-xr-xdel-service20
-rwxr-xr-xdel-shell6
-rwxr-xr-xdel-user2
-rwxr-xr-xdel-webapp2
-rw-r--r--macros.rpm-helper.in (renamed from rpm-helper.macros.in)0
-rwxr-xr-xreread-services2
-rwxr-xr-xverify-shell2
18 files changed, 117 insertions, 95 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..753ee93
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+rpm-helper-*.tar.*
diff --git a/Makefile b/Makefile
index 4972dad..97a6d86 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,12 @@
PACKAGE = rpm-helper
-VERSION = 0.24.16
+VERSION = 0.24.22
SCRIPT_FILES = add-user del-user create-file \
add-service del-service reread-services \
add-group del-group add-shell del-shell verify-shell \
add-syslog del-syslog add-webapp del-webapp \
get-password create-ssl-certificate
-MACROS_FILES = rpm-helper.macros
+MACROS_FILES = macros.rpm-helper
CONF_FILES = ssl
TEST_FILES = t/*.t
SYSTEMDMIGRATION_FILES = README.systemd
@@ -15,7 +15,7 @@ FILES = AUTHORS README COPYING NEWS Makefile \
$(TEST_FILES) $(SYSTEMDMIGRATION_FILES)
pkgdatadir = /usr/share/$(PACKAGE)
-rpmmacrosdir = /etc/rpm/macros.d
+rpmmacrodir = /usr/lib/rpm/macros.d
sysconfigdir = /etc/sysconfig
systemdmigrationdir = /var/lib/rpm-helper/systemd-migration
@@ -25,14 +25,14 @@ all:
install: $(MACROS_FILES)
install -d -m 755 $(DESTDIR)$(pkgdatadir)
cp -p $(SCRIPT_FILES) $(DESTDIR)$(pkgdatadir)
- install -d -m 755 $(DESTDIR)$(rpmmacrosdir)
- install -m 644 $(MACROS_FILES) $(DESTDIR)/$(rpmmacrosdir)
+ install -d -m 755 $(DESTDIR)$(rpmmacrodir)
+ install -m 644 $(MACROS_FILES) $(DESTDIR)/$(rpmmacrodir)
install -d -m 755 $(DESTDIR)$(sysconfigdir)
install -m 644 $(CONF_FILES) $(DESTDIR)/$(sysconfigdir)
install -d -m 755 $(DESTDIR)$(systemdmigrationdir)
install -m 644 $(SYSTEMDMIGRATION_FILES) $(DESTDIR)/$(systemdmigrationdir)
-rpm-helper.macros: rpm-helper.macros.in
+macros.rpm-helper: macros.rpm-helper.in
sed -e 's:@pkgdatadir@:$(pkgdatadir):' < $< > $@
clean:
@@ -63,4 +63,4 @@ tar:
dist: cleandist dir localcopy tar gittag
gittag:
- git tag -f v$(VERSION)
+ git tag -f v$(VERSION) -a -m "v$(VERSION)"
diff --git a/NEWS b/NEWS
index 9735173..d91a1d9 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,25 @@
- * default SSL certificates to 2048-bit (mga#15576)
+2023-01-07 Jani Välimaa <wally@mageia.org> 0.24.22
+ * rename rpm-helper.macros as macros.rpm-helper and install it into
+ /usr/lib/rpm/macros.d
+
+2020-12-20 Guillaume Rousse <guillomovitch@gmail.com> 0.24.21
+ * revert default key length for SSL certificates to 2048 bits, as it is
+ enough until 2030 according to NIST and other experts:
+ https://www.keylength.com/en/4/
+
+2020-10-04 Jani Välimaa <wally@mageia.org> 0.24.20
+ * really default to 4096 bit SSL certificates
+
+2020-10-04 Jani Välimaa <wally@mageia.org> 0.24.19
+ * default to 4096 bit SSL certificates (mga#27359)
+
+2020-07-24 Olav Vitters <ovitters@mageia.org 0.24.18
+ * correctly check if systemd has booted
+ * show project as Mageia instead of Mandriva
+ * fix loads of ShellCheck issues
+
+2015-04-01 Colin Guthrie <colin@mageia.org> 0.24.17
+ * default SSL certificates to 2048-bit (mga#15576)
2014-10-28 Colin Guthrie <colin@mageia.org> 0.24.16
* deal with xinetd.d services properly (e.g. sane mga#14397)
diff --git a/add-group b/add-group
index 603466e..3e8d967 100755
--- a/add-group
+++ b/add-group
@@ -1,6 +1,6 @@
#!/bin/sh
#---------------------------------------------------------------
-# Project : Mandriva Linux
+# Project : Mageia Linux
# Module : rpm-helper
# File : add-group
# Version : $Id$
@@ -20,8 +20,8 @@ num=$2 # number of packages installed
name=$3 # name of the group
users=$4 # users to add to this group
-if ! getent group $name > /dev/null 2>&1; then
- /usr/sbin/groupadd -r $name > /dev/null
+if ! getent group "$name" > /dev/null 2>&1; then
+ /usr/sbin/groupadd -r "$name" > /dev/null
if [ -n "$users" ]; then
SAVED_IFS="$IFS"
@@ -30,11 +30,11 @@ if ! getent group $name > /dev/null 2>&1; then
IFS="$SAVED_IFS"
for u in $*; do
- old=`egrep "[:,]$u(,|$)" /etc/group | cut -d : -f 1 | xargs echo`
+ old=$(grep -E "[:,]$u(,|$)" /etc/group | cut -d : -f 1 | xargs echo)
if [ -n "$old" ]; then
- old=`echo ",$old" | sed 's/ /,/g'`
+ old=$(echo ",$old" | sed 's/ /,/g')
fi
- /usr/sbin/usermod -G $name$old $u > /dev/null
+ /usr/sbin/usermod -G "$name$old" "$u" > /dev/null
done
fi
fi
diff --git a/add-service b/add-service
index d04b4e5..3763fca 100755
--- a/add-service
+++ b/add-service
@@ -1,6 +1,6 @@
#!/bin/bash
#---------------------------------------------------------------
-# Project : Mandriva Linux
+# Project : Mageia Linux
# Module : rpm-helper
# File : add-service
# Version : $Id$
@@ -10,7 +10,7 @@
# service.
#---------------------------------------------------------------
-if [ x$1 = x--no-sysv ]; then
+if [ "x$1" = x--no-sysv ]; then
do_sysv=no
shift
else
@@ -23,7 +23,7 @@ if [ $# -lt 3 ]; then
fi
# What init system are we currently using?
-if /bin/mountpoint -q /sys/fs/cgroup/systemd; then
+if [ -d /run/systemd/system/ ]; then
init=systemd
else
init=sysvinit
@@ -48,7 +48,7 @@ RUNTIMEUNITDIR=/run/systemd/system
SYSTEMUNITDIR=/lib/systemd/system
find_unit() {
- unit=$(basename $1)
+ unit=$(basename "$1")
# We need to normalise the systemd unit name as the native unit may not have
# the same filename (sans it's .service suffix) as sysvinit script.
@@ -70,7 +70,7 @@ find_unit() {
searchunit="$SYSTEMUNITDIR/$unit"
fi
if [ -n "$searchunit" ]; then
- echo -n $searchunit
+ echo -n "$searchunit"
fi
}
@@ -78,11 +78,11 @@ find_unit() {
# If only a sysvinit service is given, then deal with a systemd unit of the same
# name. Specific specs can enable specific unit names as needed but this should
# catch the most common usage.
-if [ -z "$units" -a -n "$srv" -a ! -f /etc/xinetd.d/$srv ]; then
+if [ -z "$units" ] && [ -n "$srv" ] && [ ! -f "/etc/xinetd.d/$srv" ]; then
units="$srv.service"
searchunit=$(find_unit $units)
if [ -n "$searchunit" ]; then
- units=$(basename $searchunit)
+ units=$(basename "$searchunit")
fi
fi
@@ -97,7 +97,7 @@ add_service() {
# during the install the symlink isn't done so find the right file
# by ourselves
- if [ -n "$DURING_INSTALL" -a ! -f $LIST ]; then
+ if [ -n "$DURING_INSTALL" ] && [ ! -f $LIST ]; then
LIST=/etc/security/msec/server.$SECURE_LEVEL
fi
@@ -107,18 +107,18 @@ add_service() {
# If SysV name was supplied, we assume units are equivalent and do
# not need to be checked.
# TODO should msec support full unit name?
- if [ -f $LIST ]; then
+ if [ -f "$LIST" ]; then
if [ -n "$srv" ]; then
- if fgrep -qx "${srv}" $LIST; then
+ if grep -Fqx "${srv}" "$LIST"; then
units_to_enable="$units"
else
srv=
fi
elif [ -n "$units" ]; then
for i in $units; do
- [ $i != ${i%.service} ] && ! fgrep -qx ${i%.service} $LIST && continue
- [ $i != ${i%.socket} ] && ! fgrep -qx ${i%.socket} $LIST && continue
- [ $i != ${i%.path} ] && ! fgrep -qx ${i%.path} $LIST && continue
+ [ "$i" != "${i%.service}" ] && ! grep -Fqx "${i%.service}" "$LIST" && continue
+ [ "$i" != "${i%.socket}" ] && ! grep -Fqx "${i%.socket}" "$LIST" && continue
+ [ "$i" != "${i%.path}" ] && ! grep -Fqx "${i%.path}" "$LIST" && continue
units_to_enable="$units_to_enable $i"
done
fi
@@ -135,7 +135,7 @@ add_service() {
echo " Please check and enable manually if necessary." >&2
echo " Service units affected: $units_to_enable" >&2
fi
- if [ -n "$srv" -a ! -f "${systemd_migration_dir}/$srv" ]; then
+ if [ -n "$srv" ] && [ ! -f "${systemd_migration_dir}/$srv" ]; then
touch "${systemd_migration_dir}/$srv"
fi
fi
@@ -146,7 +146,7 @@ add_service() {
# In order to enable switching back ot sysvinit, we should enable the
# sysvinit scripts too.
if [ -n "$srv" ]; then
- if [ -f /etc/rc.d/init.d/$srv -o -f /etc/xinetd.d/$srv ]; then
+ if [ -f /etc/rc.d/init.d/$srv ] || [ -f /etc/xinetd.d/$srv ]; then
/sbin/chkconfig --add $srv
if [ -r /etc/sysconfig/system ]; then
@@ -158,7 +158,7 @@ add_service() {
# add the service to all the profiles at once
if [ -d /etc/netprofile/profiles/default/services ]; then
for dir in /etc/netprofile/profiles/*/services; do
- touch $dir/$srv
+ touch "$dir/$srv"
done
fi
fi
@@ -175,9 +175,9 @@ check_sysvinit_service() {
echo 1>&2 "add-service: Error: $srv appears multiple times at runlevel $rl: $*"
fi
- echo -n $1
+ echo -n "$1"
}
-if [ $num = 1 ]; then
+if [ "$num" = 1 ]; then
# First install mode
if [ "null" != "$units" ]; then
add_service
@@ -190,7 +190,7 @@ else
# If a previously installed package only had a sysvinit script, but an
# updated package has a native systemd unit, we need to make sure we migrate
# any service enablement for various targets (née runlevels)
- if [ -n "$srv" -a -n "$units" ]; then
+ if [ -n "$srv" ] && [ -n "$units" ]; then
if [ ! -f "${systemd_migration_dir}/$srv" ]; then
full_path_units=
for unit in $units; do
@@ -200,7 +200,7 @@ else
# a sysvinit script and thus we'll not have anything native.
# We only consider a "migration" to have taken place when
# we genuinely have a native systemd unit.
- unit=$(find_unit $unit)
+ unit=$(find_unit "$unit")
if [ -n "$unit" ]; then
full_path_units="$full_path_units $unit"
fi
@@ -211,7 +211,7 @@ else
# We have not yet migrated this service
# First we check in which runlevels the legacy service is enabled
# Only bother checking runlevels 1 3 and 5
- script=$(check_sysvinit_service 1 $srv)
+ script=$(check_sysvinit_service 1 "$srv")
# NB We only check that the link exists as the old sysvinit
# script may have been removed during migration to systemd
@@ -220,13 +220,13 @@ else
enable_targets="$enable_targets rescue.target"
fi
- script=$(check_sysvinit_service 3 $srv)
+ script=$(check_sysvinit_service 3 "$srv")
if [ -L "$script" ]; then
enable_targets="$enable_targets multi-user.target"
else
# As graphical.target includes everything in multi-user.target,
# we only need to check 5 when 3 does NOT give us a result.
- script=$(check_sysvinit_service 5 $srv)
+ script=$(check_sysvinit_service 5 "$srv")
if [ -L "$script" ]; then
enable_targets="$enable_targets graphical.target"
fi
@@ -234,23 +234,23 @@ else
if [ -n "$enable_targets" ]; then
for unit in $full_path_units; do
- bn_unit="$(basename $unit)"
- if grep -qE "^(WantedBy|Alias)=" $unit; then
- if [ x$init = xsystemd -a x$reloaded = xno ]; then
+ bn_unit="$(basename "$unit")"
+ if grep -qE "^(WantedBy|Alias)=" "$unit"; then
+ if [ x$init = xsystemd ] && [ x$reloaded = xno ]; then
/bin/systemctl --system daemon-reload
reloaded=yes
fi
echo 1>&2 "Migrating sysvinit service '$srv' to systemd native unit '$bn_unit' via systemd install rules."
- /bin/systemctl enable $bn_unit
- elif [[ "$bn_unit" =~ "@.service" ]]; then
+ /bin/systemctl enable "$bn_unit"
+ elif [[ "$bn_unit" =~ @.service ]]; then
echo 1>&2 "Migrating sysvinit service '$srv' to systemd native template unit '$bn_unit': Failed - no install rules"
else
for enable_target in $enable_targets; do
- wantsdir=$USERUNITDIR/${enable_target}.wants
- mkdir -p $wantsdir
- if [ ! -f $wantsdir/$bn_unit ]; then
+ wantsdir="$USERUNITDIR/${enable_target}.wants"
+ mkdir -p "$wantsdir"
+ if [ ! -f "$wantsdir/$bn_unit" ]; then
echo 1>&2 "Migrating sysvinit service '$srv' to systemd native unit '$bn_unit' for target '${enable_target}'"
- ln -s $unit $wantsdir/$bn_unit
+ ln -s "$unit" "$wantsdir/$bn_unit"
reloaded=no
fi
done
@@ -270,35 +270,35 @@ else
fi
fi
- if [ x$init = xsystemd ]; then
+ if [ "x$init" = xsystemd ]; then
# Package install may have changed the unit file, so reload the daemon
# before trying to restart anything
- if [ x$reloaded = xno ]; then
+ if [ "x$reloaded" = xno ]; then
/bin/systemctl --system daemon-reload
fi
# There may be template units, so attempt to find all instances and
# restart them.
for unit in $units; do
- if [[ "$unit" =~ "@.service" ]]; then
+ if [[ "$unit" =~ @.service ]]; then
instances=$(/bin/systemctl -a --full list-units | grep -E "${unit%@.service}@[^ ]+.service" | awk '{ print $1 }')
if [ -n "$instances" ]; then
for iunit in $instances; do
- /bin/systemctl --quiet try-restart $iunit
+ /bin/systemctl --quiet try-restart "$iunit"
done
fi
elif [ "null" != "$unit" ]; then
- /bin/systemctl --quiet try-restart $unit
+ /bin/systemctl --quiet try-restart "$unit"
fi
done
- elif [ -f /etc/rc.d/init.d/$srv ]; then
- script=$(check_sysvinit_service 3 $srv);
+ elif [ -f "/etc/rc.d/init.d/$srv" ]; then
+ script=$(check_sysvinit_service 3 "$srv");
if [ -f "$script" ]; then
- /sbin/chkconfig --add $srv
+ /sbin/chkconfig --add "$srv"
fi
# restart the service if already running
- if [ -f /var/lock/subsys/$srv ]; then
- /sbin/service $srv restart > /dev/null || :
+ if [ -f "/var/lock/subsys/$srv" ]; then
+ /sbin/service "$srv" restart > /dev/null || :
fi
fi
fi
diff --git a/add-shell b/add-shell
index 2949063..4f4788e 100755
--- a/add-shell
+++ b/add-shell
@@ -1,6 +1,6 @@
#!/bin/sh
#---------------------------------------------------------------
-# Project : Mandriva Linux
+# Project : Mageia Linux
# Module : rpm-helper
# File : add-shell
# Version : $Id$
@@ -23,7 +23,7 @@ CFG_FILE=/etc/shells
# Create $CFG_FILE if needed
if [ ! -f $CFG_FILE ]; then
- > $CFG_FILE
+ true > $CFG_FILE
fi
if ! grep -q "^$shl$" $CFG_FILE; then
diff --git a/add-user b/add-user
index ac54186..39fd59a 100755
--- a/add-user
+++ b/add-user
@@ -1,6 +1,6 @@
#!/bin/sh
#---------------------------------------------------------------
-# Project : Mandriva Linux
+# Project : Mageia Linux
# Module : rpm-helper
# File : add-user
# Version : $Id$
@@ -21,9 +21,9 @@ name=$3 # name of the user
dir=$4 # home directory
shell=$5 # shell
-if ! getent passwd $name > /dev/null 2>&1; then
+if ! getent passwd "$name" > /dev/null 2>&1; then
/usr/sbin/useradd -r -M -U \
- -s $shell -d $dir -c "system user for $pkg" $name > /dev/null
+ -s "$shell" -d "$dir" -c "system user for $pkg" "$name" > /dev/null
fi
exit 0
diff --git a/add-webapp b/add-webapp
index 6468280..5d00635 100755
--- a/add-webapp
+++ b/add-webapp
@@ -8,7 +8,7 @@ fi
pkg=$1 # name of the package
num=$2 # number of packages installed
-if [ $num = 1 ]; then
+if [ "$num" = 1 ]; then
# installation: restart web server if running,
# as there is a new configuration file
/sbin/service httpd condrestart
diff --git a/create-file b/create-file
index 6ae3417..4cda1b2 100755
--- a/create-file
+++ b/create-file
@@ -1,6 +1,6 @@
#!/bin/sh
#---------------------------------------------------------------
-# Project : Mandriva Linux
+# Project : Mageia Linux
# Module : rpm-helper
# File : create-file
# Version : $Id$
@@ -22,10 +22,10 @@ owner=$4 # owner of the file
group=$5 # group of the file
mode=$6 # mode of the file
-if [ ! -f $file ]; then
- touch $file
- chown $owner:$group $file
- chmod $mode $file
+if [ ! -f "$file" ]; then
+ touch "$file"
+ chown "$owner:$group" "$file"
+ chmod "$mode" "$file"
fi
# create-file ends here
diff --git a/create-ssl-certificate b/create-ssl-certificate
index 599719b..a0d7352 100755
--- a/create-ssl-certificate
+++ b/create-ssl-certificate
@@ -14,12 +14,12 @@ pkg=${args[0]} # name of the package
num=${args[1]} # number of packages installed
srv=${args[2]} # name of the service
-if [ -z "$pkg" -o -z "$num" -o -z "$srv" ]; then
+if [ -z "$pkg" ] || [ -z "$num" ] || [ -z "$srv" ]; then
echo "usage: $0 [-g <group>] [-b] <pkg name> <num installed> <service>" 1>&2
exit 1
fi
-if [ ! -f /etc/pki/tls/private/$srv.pem ]; then
+if [ ! -f "/etc/pki/tls/private/$srv.pem" ]; then
# default values
host=$(hostname)
KEY_LENGTH=2048
@@ -35,7 +35,7 @@ if [ ! -f /etc/pki/tls/private/$srv.pem ]; then
conffile=/tmp/$$
keyfile=/etc/pki/tls/private/$srv.pem
- if [ "$bundle" == true ]; then
+ if [ "$bundle" = "true" ]; then
certfile=$keyfile
else
certfile=/etc/pki/tls/certs/$srv.pem
@@ -59,16 +59,16 @@ basicConstraints = CA:FALSE
EOF
# generate certificates
- openssl req -new -x509 -days $CERT_DAYS \
- -config $conffile \
- -keyout $keyfile \
- -out $certfile >/dev/null
+ openssl req -new -x509 -days "$CERT_DAYS" \
+ -config "$conffile" \
+ -keyout "$keyfile" \
+ -out "$certfile" >/dev/null
# enforce strict perms on key
if [ -n "$group" ]; then
- chmod 640 $keyfile
- chgrp $group $keyfile
+ chmod 640 "$keyfile"
+ chgrp "$group" "$keyfile"
else
- chmod 600 $keyfile
+ chmod 600 "$keyfile"
fi
fi
diff --git a/del-group b/del-group
index 6949791..870f9b7 100755
--- a/del-group
+++ b/del-group
@@ -1,6 +1,6 @@
#!/bin/sh
#---------------------------------------------------------------
-# Project : Mandriva Linux
+# Project : Mageia Linux
# Module : rpm-helper
# File : del-group
# Version : $Id$
diff --git a/del-service b/del-service
index 55c26bf..6b9984b 100755
--- a/del-service
+++ b/del-service
@@ -1,6 +1,6 @@
#!/bin/sh
#---------------------------------------------------------------
-# Project : Mandriva Linux
+# Project : Mageia Linux
# Module : rpm-helper
# File : del-service
# Version : $Id$
@@ -10,7 +10,7 @@
# service.
#---------------------------------------------------------------
-if [ x$1 = x--no-sysv ]; then
+if [ x"$1" = x--no-sysv ]; then
do_sysv=no
shift
else
@@ -23,7 +23,7 @@ if [ $# -lt 3 ]; then
fi
# What init system are we currently using?
-if /bin/mountpoint -q /sys/fs/cgroup/systemd; then
+if [ -d /run/systemd/system/ ]; then
init=systemd
else
init=sysvinit
@@ -45,7 +45,7 @@ RUNTIMEUNITDIR=/run/systemd/system
SYSTEMUNITDIR=/lib/systemd/system
find_unit() {
- unit=$(basename $1)
+ unit=$(basename "$1")
# We need to normalise the systemd unit name as the native unit may not have
# the same filename (sans it's .service suffix) as sysvinit script.
@@ -67,7 +67,7 @@ find_unit() {
searchunit="$SYSTEMUNITDIR/$unit"
fi
if [ -n "$searchunit" ]; then
- echo -n $searchunit
+ echo -n "$searchunit"
fi
}
@@ -77,25 +77,25 @@ find_unit() {
# catch the most common usage.
if [ -z "$units" ]; then
units="$srv.service"
- searchunit=$(find_unit $units)
+ searchunit=$(find_unit "$units")
if [ -n "$searchunit" ]; then
- units=$(basename $searchunit)
+ units=$(basename "$searchunit")
fi
fi
-if [ $num = 0 ]; then
+if [ "$num" = 0 ]; then
if [ -z "$DURING_INSTALL" ]; then
if [ x$init = xsystemd ]; then
/bin/systemctl stop $units >/dev/null 2>&1
- elif [ -n "srv" ]; then
+ elif [ -n "$srv" ]; then
/sbin/service $srv stop > /dev/null || :
fi
fi
/bin/systemctl --no-reload --quiet disable $units >/dev/null 2>&1
if [ -n "$srv" ]; then
- if [ -f /etc/rc.d/init.d/$srv -o -f /etc/xinetd.d/$srv ]; then
+ if [ -f /etc/rc.d/init.d/$srv ] || [ -f /etc/xinetd.d/$srv ]; then
/sbin/chkconfig --del $srv
fi
fi
diff --git a/del-shell b/del-shell
index baeee15..e485697 100755
--- a/del-shell
+++ b/del-shell
@@ -1,6 +1,6 @@
#!/bin/sh
#---------------------------------------------------------------
-# Project : Mandriva Linux
+# Project : Mageia Linux
# Module : rpm-helper
# File : del-shell
# Version : $Id$
@@ -23,12 +23,12 @@ CFG_FILE=/etc/shells
# Create $CFG_FILE if needed
if [ ! -f $CFG_FILE ]; then
- > $CFG_FILE
+ true > $CFG_FILE
exit 0
fi
if [ "$num" = 0 ]; then
- if [ ! -x $shl ]; then
+ if [ ! -x "$shl" ]; then
grep -v "^$shl$" < $CFG_FILE > $CFG_FILE.new
mv -f $CFG_FILE.new $CFG_FILE
fi
diff --git a/del-user b/del-user
index 5938c97..78cb261 100755
--- a/del-user
+++ b/del-user
@@ -1,6 +1,6 @@
#!/bin/sh
#---------------------------------------------------------------
-# Project : Mandriva Linux
+# Project : Mageia Linux
# Module : rpm-helper
# File : del-user
# Version : $Id$
diff --git a/del-webapp b/del-webapp
index ec407a8..c51ed5e 100755
--- a/del-webapp
+++ b/del-webapp
@@ -8,7 +8,7 @@ fi
pkg=$1 # name of the package
num=$2 # number of packages installed
-if [ $num = 0 ]; then
+if [ "$num" = 0 ]; then
# in simultaneous removal scenario, web server may
# already have been removed
if [ -f /etc/init.d/httpd ]; then
diff --git a/rpm-helper.macros.in b/macros.rpm-helper.in
index 1703bc4..1703bc4 100644
--- a/rpm-helper.macros.in
+++ b/macros.rpm-helper.in
diff --git a/reread-services b/reread-services
index 73092d6..635c9ff 100755
--- a/reread-services
+++ b/reread-services
@@ -16,7 +16,7 @@ if [ $# -lt 1 ]; then
fi
# What init system are we currently using?
-if /bin/mountpoint -q /sys/fs/cgroup/systemd; then
+if [ -d /run/systemd/system/ ]; then
init=systemd
else
init=sysvinit
diff --git a/verify-shell b/verify-shell
index 3aeefe6..8b50654 100755
--- a/verify-shell
+++ b/verify-shell
@@ -1,6 +1,6 @@
#!/bin/sh
#---------------------------------------------------------------
-# Project : Mandriva Linux
+# Project : Mageia Linux
# Module : rpm-helper
# File : verify-shell
# Version : $Id$