Proberly use UID check and escape $0
[grml2usb.git] / tarball.sh
index d5f850e..895d3ed 100755 (executable)
@@ -43,8 +43,8 @@ cat > "${DIR}"/install.sh << EOF
 
 set -e
 
-if [ "\$UID" != 0 ] ; then
-   echo "Error: become root before starting $0" >& 2
+if [ \$(id -u) != 0 ] ; then
+   echo "Error: become root before starting \$0" >& 2
    exit 1
 fi
 
@@ -93,8 +93,8 @@ cat > "${DIR}"/uninstall.sh << EOF
 
 set -e
 
-if [ "\$UID" != 0 ] ; then
-   echo "Error: become root before starting $0" >& 2
+if [ \$(id -u) != 0 ] ; then
+   echo "Error: become root before starting \$0" >& 2
    exit 1
 fi