Skip to content

Commit 1f01582

Browse files
committed
fix the bug of switch to root can't find the script: set the absolute path
1 parent a552f70 commit 1f01582

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

bashrc/fedora-install.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22

3-
AUTO_INVOKE_SUDO=yes
3+
AUTO_INVOKE_SUDO=yes;
4+
curdir=$(dirname $(readlink -f $0));
45

56
function invoke_sudo()
67
{
@@ -16,7 +17,7 @@ function invoke_sudo()
1617

1718
uid=`id -u`
1819
if [ $uid -ne '0' ]; then
19-
invoke_sudo root "$0 $@"
20+
invoke_sudo root "${curdir}/$0 $@"
2021
fi
2122
#------------------------------------------------------------------------------
2223
# Prerequisites

0 commit comments

Comments
 (0)