Explorar o código

replace with sed again

UltimateByte %!s(int64=9) %!d(string=hai) anos
pai
achega
99c29531f3
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      lgsm/functions/mods_core.sh

+ 1 - 1
lgsm/functions/mods_core.sh

@@ -185,7 +185,7 @@ fn_mod_add_list(){
 		fn_script_log "Created ${modslockfilefullpath}"
 	fi
 	# Input mod name to lockfile
-	if [ ! -n "$(cat "${modslockfilefullpath}" | grep "${modcommand}")" ]; then
+	if [ ! -n "$(sed -n "/^${modcommand}$/p" "${modslockfilefullpath}")" ]; then
 		echo "${modcommand}" >> "${modslockfilefullpath}"
 		fn_script_log "${modcommand} added to ${modslockfile}"
 	fi