ok, here it is. I'm trying to do a bash script to update the binary of an application using lynx. but, the problem is, i cant get it to work. i tried to remove the null part of my script and its working. but, i want the null part to make sure that the lynx is installed. i'm using debian10 as of now. The error is: please install lynx package ok, here is my script. note: the lynx is install as of now.
#!/bin/bash
if which $appname > /dev/null 2>/dev/null;then
sleep .01
else
$0 binupdate
$0 $@
fi
if [ -z $1 ];then
echo specify command. Valid commands are: disable, enable, new, remove, restart, start, stop
exit 1
fi
case "$1" in
binupdate)
if which lynx > /dev/null 2>/dev/null;then
echo please install lynx package
exit 2
fi
if id -u|grep -qw 0;then
#some process#
cd /usr/bin
curl $url|tar --strip-components=2 -xz $dirname/appname
else
echo please run binary updates as root by running: sudo $0 binupdate
fi
;;