简体   繁体   中英

Bash variable in pagekite startup command

I have my own pagekite.py frontend at kite.mydomain.com I'm trying to start pagekite.py with a bash script on an older FreeBSD machine and can't seem to get this right. The first line of systemname.txt contains the internalID of the system. I'm then trying to start the backend of pagekite.py at internalID.kite.mydomain.com but this does not seem to work?

#!/bin/sh
sid=`head -n 1 /usr/local/www/systemname.txt`
python /usr/local/pagekite/pagekite.py --frontend=kite.mydomain.com:8080 --service_on=http:$sid.kite.mydomain.com:localhost:80:MYSECRETHASH &

When I manually run the command, it works just fine.

python /usr/local/pagekite/pagekite.py --frontend=kite.mydomain.com:8080 --service_on=http:internalID.kite.mydomain.com:localhost:80:MYSECRETHASH &

If you have text files that were created on a windows box, lines are delimited with \\r\\n . Unix (Linux, OSX, *BSD) likes its lines delimited with just \\n and scripts can fail in odd ways if they are not.

You can convert from one to the other with the dos2unix and unix2dos utilities .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM