#!/bin/sh VAR_FILES="/var/lib/llxcfg/vars/10_llxcfg_setvars /etc/llxcfg/vars/10_llxcfg_setvars" purge_file(){ [ "$1" ] || return 0 [ -w "$1" ] || return 0 TMP_FILE="$(tempfile)" cp -a "$1" "$TMP_FILE" grep "^[[:blank:]]*[[:alnum:]_]\+[[:blank:]]*=" "$1" > "$TMP_FILE" sed -i -e "s%=[[:blank:]]*$%= ''%" "$TMP_FILE" mv "$TMP_FILE" "$1" return 0 } for f in $VAR_FILES ; do purge_file "$f" done exit 0