From a8353787edb59dc0cdc050e91020e2eb5254ada1 Mon Sep 17 00:00:00 2001 From: nativemad Date: Tue, 13 Nov 2018 18:23:44 +0100 Subject: [PATCH] some fixed paths for centos --- nlvmi | 7 ++++--- web/.sha512 | Bin 512 -> 0 bytes web/index.php | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) delete mode 100644 web/.sha512 diff --git a/nlvmi b/nlvmi index ea7c394..0d48f5b 100755 --- a/nlvmi +++ b/nlvmi @@ -12,7 +12,6 @@ if [ $U != "root" ]; then if [ ! -z $3 ]; then C=$3; else C="bla"; fi /usr/bin/wrap-nlvmi $A $B $C && exit fi - if [ ! -d $RUNDIRECTORY ]; then if [ $LOGLEVEL -gt "1" ]; then echo "creating $RUNDIRECTORY"; fi; mkdir -p $RUNDIRECTORY; chown root:nlvmi -R $RUNDIRECTORY; chmod g+w $RUNDIRECTORY; fi #checking database @@ -163,7 +162,7 @@ function vmstart { if [ ! -z ${array[19]} ]; then CDROM="-cdrom ${array[19]}"; fi if [ ! -z ${array[20]} ]; then TAPDEV1="-netdev tap,ifname=${array[20]},script=no,id=net0"; echo "which tunctl && tunctl -t ${array[20]} -u ${array[2]} >/dev/null || ip tuntap add ${array[20]} mode tap user ${array[2]}; ifconfig ${array[20]} up" >>$TMPF; fi if [ ! -z ${array[21]} ]; then MACADDR1="-net nic,macaddr=${array[21]},model=virtio,netdev=net0"; fi - if [ ! -z ${array[22]} ]; then BRDEV1="${array[22]}"; echo "if [ -L /sys/devices/virtual/net/${array[20]}/master ]; then OLDBR=\`readlink -f /sys/devices/virtual/net/${array[20]}/master | rev | cut -d "/" -f1 | rev\`; brctl delif \$OLDBR ${array[20]}; fi; /sbin/brctl addif ${array[22]} ${array[20]} >/dev/null" >>$TMPF; fi + if [ ! -z ${array[22]} ]; then BRDEV1="${array[22]}"; TAPDS1=`echo ${array[20]} | cut -c 1-15`; echo "if [ -L /sys/devices/virtual/net/${TAPDS1}/master ]; then OLDBR=\`readlink -f /sys/devices/virtual/net/${TAPDS1}/master | rev | cut -d "/" -f1 | rev\`; brctl delif \$OLDBR ${array[20]}; fi; /sbin/brctl addif ${array[22]} ${array[20]} >/dev/null" >>$TMPF; fi if [ ! -z ${array[23]} ]; then TAPDEV2="-netdev tap,ifname=${array[23]},script=no,id=net1"; echo "which tunctl && tunctl -t ${array[23]} -u ${array[2]} >/dev/null || ip tuntap add ${array[23]} mode tap user ${array[2]}; ifconfig ${array[23]} up" >>$TMPF; fi if [ ! -z ${array[24]} ]; then MACADDR2="-net nic,macaddr=${array[24]},model=virtio,netdev=net1"; fi if [ ! -z ${array[25]} ]; then BRDEV2="${array[25]}"; echo "if [ -L /sys/devices/virtual/net/${array[23]}/master ]; then OLDBR=\`readlink -f /sys/devices/virtual/net/${array[23]}/master | rev | cut -d "/" -f1 | rev\`; brctl delif \$OLDBR ${array[23]}; fi; /sbin/brctl addif ${array[25]} ${array[23]} >/dev/null" >>$TMPF; fi @@ -173,7 +172,8 @@ function vmstart { if [ ! -z ${array[30]} ]; then WPORT=$((${array[30]} + 5700)); WEBSOCK=",websocket=$WPORT"; else WEBSOCK=""; fi if [ ! -z ${array[31]} ]; then VNCPASS=",password"; fi if [ ! -z ${array[29]} ]; then VNCPORT="-vnc :${array[29]}$WEBSOCK$VNCPASS"; fi - COMMAND=(su - ${array[2]} -s /bin/bash -c \"${array[4]} -name ${array[1]} -enable-kvm ${array[10]} $CPUTYPE $MEMORY $SMP -device virtio-rng-pci -boot ${array[11]} $USBDEV $KB -daemonize $DRIVE1$FORMAT1 $DRIVE2$FORMAT2 $DRIVE3$FORMAT3 $CDROM $MACADDR1 $TAPDEV1 $MACADDR2 $TAPDEV2 $MACADDR3 $TAPDEV3 $VNCPORT $CUSTOM -pidfile $RUNDIRECTORY/${array[1]}.pid -monitor unix:$RUNDIRECTORY/${array[1]}.mon,server,nowait\") + echo "which ${array[4]} && QEMUCONNAMD=${array[4]} || QEMUCOMMAND=/usr/libexec/qemu-kvm" >>$TMPF + COMMAND=(su - ${array[2]} -s /bin/bash -c \"\$QEMUCOMMAND -name ${array[1]} -enable-kvm ${array[10]} $CPUTYPE $MEMORY $SMP -device virtio-rng-pci -boot ${array[11]} $USBDEV $KB -daemonize $DRIVE1$FORMAT1 $DRIVE2$FORMAT2 $DRIVE3$FORMAT3 $CDROM $MACADDR1 $TAPDEV1 $MACADDR2 $TAPDEV2 $MACADDR3 $TAPDEV3 $VNCPORT $CUSTOM -pidfile $RUNDIRECTORY/${array[1]}.pid -monitor unix:$RUNDIRECTORY/${array[1]}.mon,server,nowait\") if [ $LOGLEVEL -gt "1" ]; then echo ${COMMAND[@]}; fi echo "${COMMAND[@]}" >>$TMPF #Set VNC Password @@ -350,6 +350,7 @@ if [ $# -gt 0 ]; then if [ ! -z $MASTERSERVER ]; then if `echo $SSH_CLIENT | grep "$MASTERSERVER " &>/dev/null`; then if [ -e $2 ]; then + source /etc/profile openssl dgst -sha512 -verify <(openssl x509 -in "/etc/nlvmi/nlvmi_sign.crt" -pubkey -noout) -signature $2.sha512 $2 >/dev/null && /bin/bash $2 || echo "signature failed!!" fi else diff --git a/web/.sha512 b/web/.sha512 deleted file mode 100644 index 12bb389ab91ca33207c6925165189690420857f4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 512 zcmV+b0{{Jg0Mt$~4-=(h1p)3-1ri>heO17fMR;1t*9}~zxhDd2vGbaRxSkIP&Z5^A z&{*tPh%nS|%!nPw=3DRrkV(NQ03>Ac;8I?rvPPh_Ixu__UwCP8u11|`OP{XPwvWUF zCW->)tHs=p$OCxOclG??dN)cTF@-a#aoCj8^^qnAHgv28xg7g77-bJur~FI5e}Y*i zs%t9v&d*}?9?fW6tJ;xV6Bmi+Z99y#QG@Rw-8Bq#si30DOC%U75zPD-tcRoGPgWV_~< zgwN`OW}S=-Evr~&eNCnnp1b5)CQ__gQ1ot^N0BfbnSRdZo@sPncGCdV>4CnIG?`&V z`-h5(5A}V6`I}7Vhfrbo^t!LqTx~PGp4Ea6?)Nk39wvdK&pVuj1;it&jC z8_)S<&%{5`1N6bM!2p25-$X CU-{Yq diff --git a/web/index.php b/web/index.php index 598949e..a1d5224 100644 --- a/web/index.php +++ b/web/index.php @@ -683,7 +683,7 @@ if (isset($_SESSION['username'])){ echo "$button "; echo " "; if ($row['websocket']!=""){ - $server = $_SERVER['HTTP_HOST']; + $server = $row['server']; $websocketport = $row['websocket'] + 5700; $wpath=""; if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])){